mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
Add song/genre sync
This commit is contained in:
parent
b2c269a051
commit
76037e487b
47 changed files with 703 additions and 89 deletions
|
|
@ -19,6 +19,21 @@ import java.util.UUID;
|
|||
|
||||
@Entity(tableName = "song")
|
||||
public class Song implements Parcelable {
|
||||
@Ignore
|
||||
public static final String RECENTLY_PLAYED = "RECENTLY_PLAYED";
|
||||
|
||||
@Ignore
|
||||
public static final String MOST_PLAYED = "MOST_PLAYED";
|
||||
|
||||
@Ignore
|
||||
public static final String RECENTLY_ADDED = "RECENTLY_ADDED";
|
||||
|
||||
@Ignore
|
||||
public static final String BY_GENRE = "BY_GENRE";
|
||||
|
||||
@Ignore
|
||||
public static final String BY_ARTIST = "BY_ARTIST";
|
||||
|
||||
@NonNull
|
||||
@PrimaryKey
|
||||
@ColumnInfo(name = "id")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,91 @@
|
|||
package com.cappielloantonio.play.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import org.jellyfin.apiclient.model.dto.BaseItemDto;
|
||||
import org.jellyfin.apiclient.model.dto.MediaSourceInfo;
|
||||
import org.jellyfin.apiclient.model.entities.ImageType;
|
||||
import org.jellyfin.apiclient.model.entities.MediaStream;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity(tableName = "song_genre_cross")
|
||||
public class SongGenreCross implements Parcelable {
|
||||
@NonNull
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(name = "id")
|
||||
private int id;
|
||||
|
||||
@ColumnInfo(name = "song_id")
|
||||
private String songId;
|
||||
|
||||
@ColumnInfo(name = "genre_id")
|
||||
private String genreId;
|
||||
|
||||
public SongGenreCross(String songId, String genreId) {
|
||||
this.songId = songId;
|
||||
this.genreId = genreId;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSongId() {
|
||||
return songId;
|
||||
}
|
||||
|
||||
public void setSongId(String songId) {
|
||||
this.songId = songId;
|
||||
}
|
||||
|
||||
public String getGenreId() {
|
||||
return genreId;
|
||||
}
|
||||
|
||||
public void setGenreId(String genreId) {
|
||||
this.genreId = genreId;
|
||||
}
|
||||
|
||||
protected SongGenreCross(Parcel in) {
|
||||
id = in.readInt();
|
||||
songId = in.readString();
|
||||
genreId = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(id);
|
||||
dest.writeString(songId);
|
||||
dest.writeString(genreId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<SongGenreCross> CREATOR = new Creator<SongGenreCross>() {
|
||||
@Override
|
||||
public SongGenreCross createFromParcel(Parcel in) {
|
||||
return new SongGenreCross(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SongGenreCross[] newArray(int size) {
|
||||
return new SongGenreCross[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue