mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
Made the due distinction based on the server on the most listened to songs of the week
This commit is contained in:
parent
5eed437c5b
commit
1204716a65
6 changed files with 29 additions and 14 deletions
|
|
@ -23,13 +23,11 @@ import com.cappielloantonio.play.model.Server;
|
|||
|
||||
@SuppressLint("RestrictedApi")
|
||||
@Database(
|
||||
version = 42,
|
||||
version = 43,
|
||||
entities = {Queue.class, Server.class, RecentSearch.class, Download.class, Playlist.class, Chronology.class},
|
||||
autoMigrations = {@AutoMigration(from = 41, to = 42)}
|
||||
autoMigrations = {@AutoMigration(from = 42, to = 43)}
|
||||
)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
private static final String TAG = "AppDatabase";
|
||||
|
||||
private final static String DB_NAME = "play_db";
|
||||
private static AppDatabase instance;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ import java.util.List;
|
|||
|
||||
@Dao
|
||||
public interface ChronologyDao {
|
||||
@Query("SELECT * FROM chronology WHERE timestamp >= :startDate AND timestamp < :endDate GROUP BY id ORDER BY COUNT(id) DESC LIMIT 9")
|
||||
LiveData<List<Chronology>> getAllFrom(long startDate, long endDate);
|
||||
@Query("SELECT * FROM chronology WHERE timestamp >= :startDate AND timestamp < :endDate AND server == :server GROUP BY id ORDER BY COUNT(id) DESC LIMIT 9")
|
||||
LiveData<List<Chronology>> getAllFrom(long startDate, long endDate, String server);
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insert(Chronology chronologyObject);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue