From ed95bd14d3f49db15031e6d81ae8bc2208afec56 Mon Sep 17 00:00:00 2001 From: Nikifor Fedorov Date: Sat, 16 May 2020 13:00:23 +0300 Subject: [PATCH] fixed not building --- .../ru/krivocraft/tortoise/sqlite/DBConnection.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ru/krivocraft/tortoise/sqlite/DBConnection.java b/app/src/main/java/ru/krivocraft/tortoise/sqlite/DBConnection.java index 3a4d541..3446cee 100644 --- a/app/src/main/java/ru/krivocraft/tortoise/sqlite/DBConnection.java +++ b/app/src/main/java/ru/krivocraft/tortoise/sqlite/DBConnection.java @@ -26,6 +26,8 @@ import ru.krivocraft.tortoise.core.model.Track; import ru.krivocraft.tortoise.core.model.TrackList; import ru.krivocraft.tortoise.core.model.TrackReference; +import ru.krivocraft.tortoise.core.model.track.TrackMeta; +import ru.krivocraft.tortoise.core.model.track.TrackPlayingState; import ru.krivocraft.tortoise.core.settings.SettingsStorageManager; import ru.krivocraft.tortoise.thumbnail.Colors; @@ -87,7 +89,7 @@ public void removeTrack(Track track) { } public Track getTrack(TrackReference trackReference) { - Track track = new Track(0, "", "", "", Colors.GREEN, 0); + Track track = new Track(new TrackMeta("", "", "", 0, Colors.GREEN), 0); Cursor cursor = database.query(TRACKS, null, "id = ?", new String[]{trackReference.toString()}, null, null, null); if (cursor.moveToFirst()) { @@ -102,7 +104,7 @@ public Track getTrack(TrackReference trackReference) { boolean playing = cursor.getInt(cursor.getColumnIndex("playing")) == 1; boolean ignored = cursor.getInt(cursor.getColumnIndex("ignored")) == 1; - track = new Track(duration, artist, title, path, liked, selected, playing, color, ignored, rating); + track = new Track(new TrackMeta(title, artist, path, duration, color), new TrackPlayingState(selected, playing), liked, ignored, rating); } cursor.close(); return track; @@ -188,7 +190,7 @@ public List getTracksStorage() { int color = cursor.getInt(colorIndex); int rating = cursor.getInt(ratingIndex); - Track track = new Track(duration, artist, title, path, liked, selected, playing, color, ignored, rating); + Track track = new Track(new TrackMeta(title, artist, path, duration, color), new TrackPlayingState(selected, playing), liked, ignored, rating); tracks.add(track); } while (cursor.moveToNext()); } @@ -417,7 +419,7 @@ private void generateColors(SQLiteDatabase db) { boolean ignored = cursor.getInt(ignoredIndex) == 1; int color = cursor.getInt(colorIndex); - Track track = new Track(duration, artist, title, path, liked, selected, playing, color, ignored, rating); + Track track = new Track(new TrackMeta(title, artist, path, duration, color), new TrackPlayingState(selected, playing), liked, ignored, rating); updateColor(db, track); } while (cursor.moveToNext()); }