Skip to content

Commit

Permalink
Merge pull request #34 from zelenyhleb/develop
Browse files Browse the repository at this point in the history
fixed not building
  • Loading branch information
zelenyhleb authored May 16, 2020
2 parents 334cef3 + ed95bd1 commit 2198777
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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()) {

Expand All @@ -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;
Expand Down Expand Up @@ -188,7 +190,7 @@ public List<Track> 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());
}
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 2198777

Please sign in to comment.