mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
Removed Jellyfin dependencies
This commit is contained in:
parent
737eaa1822
commit
9495fbd83d
16 changed files with 62 additions and 310 deletions
|
|
@ -2,7 +2,6 @@ package com.cappielloantonio.play.model;
|
|||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
|
|
@ -12,13 +11,6 @@ import androidx.room.PrimaryKey;
|
|||
|
||||
import com.cappielloantonio.play.subsonic.models.AlbumID3;
|
||||
|
||||
import org.jellyfin.apiclient.model.dto.BaseItemDto;
|
||||
import org.jellyfin.apiclient.model.entities.ImageType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity(tableName = "album")
|
||||
public class Album implements Parcelable {
|
||||
private static final String TAG = "Album";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.cappielloantonio.play.model;
|
|||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
|
|
@ -10,10 +9,6 @@ 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.GenreDto;
|
||||
import org.jellyfin.apiclient.model.entities.ImageType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -56,39 +51,6 @@ public class Artist implements Parcelable {
|
|||
this.backdropBlurHash = backdropBlurHash;
|
||||
}
|
||||
|
||||
@Ignore
|
||||
public Artist(BaseItemDto itemDto) {
|
||||
this.id = itemDto.getId();
|
||||
this.name = itemDto.getName();
|
||||
|
||||
this.primary = itemDto.getImageTags().containsKey(ImageType.Primary) ? id : null;
|
||||
if (itemDto.getImageBlurHashes() != null && itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
||||
this.primaryBlurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
||||
}
|
||||
|
||||
try {
|
||||
this.backdrop = !itemDto.getBackdropImageTags().get(0).isEmpty() ? id : null;
|
||||
if (itemDto.getImageBlurHashes() != null && itemDto.getBackdropImageTags().get(0) != null) {
|
||||
this.backdropBlurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Backdrop).values().toArray()[0];
|
||||
}
|
||||
}
|
||||
catch (IndexOutOfBoundsException exception) {
|
||||
this.backdrop = null;
|
||||
this.backdropBlurHash = null;
|
||||
}
|
||||
|
||||
|
||||
this.genres = new ArrayList<>();
|
||||
this.albums = new ArrayList<>();
|
||||
this.songs = new ArrayList<>();
|
||||
|
||||
if (itemDto.getGenreItems() != null) {
|
||||
for (GenreDto genre : itemDto.getGenreItems()) {
|
||||
genres.add(new Genre(genre));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore
|
||||
public Artist(String id, String name) {
|
||||
this.id = id;
|
||||
|
|
|
|||
|
|
@ -6,15 +6,8 @@ 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.GenreDto;
|
||||
import org.jellyfin.apiclient.model.entities.ImageType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity(tableName = "genre")
|
||||
public class Genre implements Parcelable {
|
||||
@NonNull
|
||||
|
|
@ -42,25 +35,6 @@ public class Genre implements Parcelable {
|
|||
this.blurHash = blurHash;
|
||||
}
|
||||
|
||||
@Ignore
|
||||
public Genre(GenreDto genreDto) {
|
||||
this.id = genreDto.getId();
|
||||
this.name = genreDto.getName();
|
||||
this.songCount = 0;
|
||||
}
|
||||
|
||||
@Ignore
|
||||
public Genre(BaseItemDto itemDto) {
|
||||
this.id = itemDto.getId();
|
||||
this.name = itemDto.getName();
|
||||
this.songCount = itemDto.getSongCount() != null ? itemDto.getSongCount() : 0;
|
||||
|
||||
this.primary = itemDto.getImageTags().containsKey(ImageType.Primary) ? id : null;
|
||||
if (itemDto.getImageBlurHashes() != null && itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
||||
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getId() {
|
||||
return id;
|
||||
|
|
|
|||
|
|
@ -6,12 +6,8 @@ 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.entities.ImageType;
|
||||
|
||||
@Entity(tableName = "playlist")
|
||||
public class Playlist implements Parcelable {
|
||||
@NonNull
|
||||
|
|
@ -35,17 +31,6 @@ public class Playlist implements Parcelable {
|
|||
this.blurHash = blurHash;
|
||||
}
|
||||
|
||||
@Ignore
|
||||
public Playlist(BaseItemDto itemDto) {
|
||||
this.id = itemDto.getId();
|
||||
this.name = itemDto.getName();
|
||||
|
||||
this.primary = itemDto.getImageTags().containsKey(ImageType.Primary) ? id : null;
|
||||
if (itemDto.getImageBlurHashes() != null && itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
||||
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getId() {
|
||||
return id;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.cappielloantonio.play.model;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
|
|
@ -13,15 +12,7 @@ import androidx.room.PrimaryKey;
|
|||
|
||||
import com.cappielloantonio.play.subsonic.models.Child;
|
||||
|
||||
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.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity(tableName = "song")
|
||||
|
|
@ -341,7 +332,9 @@ public class Song implements Parcelable {
|
|||
this.playCount = playCount;
|
||||
}
|
||||
|
||||
public void setOffline(boolean offline) { this.offline = offline; }
|
||||
public void setOffline(boolean offline) {
|
||||
this.offline = offline;
|
||||
}
|
||||
|
||||
/*
|
||||
Log.i(TAG, "increasePlayCount: " + isIncreased);
|
||||
|
|
@ -354,7 +347,7 @@ public class Song implements Parcelable {
|
|||
public boolean nowPlaying() {
|
||||
long startPlayTime = Instant.now().toEpochMilli();
|
||||
|
||||
if(startPlayTime - (getDuration()/2) > getLastPlay()) {
|
||||
if (startPlayTime - (getDuration() / 2) > getLastPlay()) {
|
||||
this.playCount++;
|
||||
this.lastPlay = startPlayTime;
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -6,17 +6,8 @@ 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue