From 17372fc4d075f6581644a07feb8a19fe230f5f46 Mon Sep 17 00:00:00 2001 From: le-firehawk Date: Fri, 3 Oct 2025 23:30:55 +0930 Subject: [PATCH] fix: Resolve parcel serialization build warnings --- .../tempo/model/Chronology.kt | 12 ++-- .../cappielloantonio/tempo/model/Download.kt | 18 +++--- .../com/cappielloantonio/tempo/model/Queue.kt | 16 +++-- .../tempo/subsonic/models/AlbumID3.kt | 60 +++++++++---------- .../subsonic/models/AlbumWithSongsID3.kt | 6 +- .../tempo/subsonic/models/Artist.kt | 14 ++--- .../tempo/subsonic/models/ArtistID3.kt | 16 ++--- .../subsonic/models/ArtistWithAlbumsID3.kt | 6 +- .../tempo/subsonic/models/Directory.kt | 20 +++---- .../tempo/subsonic/models/DiscTitle.kt | 8 +-- .../tempo/subsonic/models/Genre.kt | 10 ++-- .../subsonic/models/InternetRadioStation.kt | 12 ++-- .../tempo/subsonic/models/ItemDate.kt | 13 ++-- .../tempo/subsonic/models/ItemGenre.kt | 6 +- .../tempo/subsonic/models/MusicFolder.kt | 8 +-- .../tempo/subsonic/models/NowPlayingEntry.kt | 13 ++-- .../tempo/subsonic/models/Playlist.kt | 46 +++++++++++--- .../subsonic/models/PlaylistWithSongs.kt | 7 +-- .../tempo/subsonic/models/Playlists.kt | 2 +- .../tempo/subsonic/models/PodcastChannel.kt | 23 +++---- .../tempo/subsonic/models/PodcastEpisode.kt | 53 ++++++++-------- .../tempo/subsonic/models/RecordLabel.kt | 7 ++- .../tempo/subsonic/models/Share.kt | 3 +- .../service/MediaLibraryServiceCallback.kt | 7 +-- .../tempo/service/MediaService.kt | 1 + .../cappielloantonio/tempo/util/Flavors.java | 1 + 26 files changed, 205 insertions(+), 183 deletions(-) diff --git a/app/src/main/java/com/cappielloantonio/tempo/model/Chronology.kt b/app/src/main/java/com/cappielloantonio/tempo/model/Chronology.kt index 18a77bfa..a3b142e2 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/model/Chronology.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/model/Chronology.kt @@ -8,18 +8,18 @@ import androidx.room.PrimaryKey import com.cappielloantonio.tempo.subsonic.models.Child import com.cappielloantonio.tempo.util.Preferences import kotlinx.parcelize.Parcelize -import java.util.* +import java.util.Date @Keep @Parcelize @Entity(tableName = "chronology") -class Chronology(@PrimaryKey override val id: String) : Child(id) { +class Chronology( + @PrimaryKey override val id: String, @ColumnInfo(name = "timestamp") - var timestamp: Long = System.currentTimeMillis() - + var timestamp: Long = System.currentTimeMillis(), @ColumnInfo(name = "server") - var server: String? = null - + var server: String? = null, +) : Child(id) { constructor(mediaItem: MediaItem) : this(mediaItem.mediaMetadata.extras!!.getString("id")!!) { parentId = mediaItem.mediaMetadata.extras!!.getString("parentId") isDir = mediaItem.mediaMetadata.extras!!.getBoolean("isDir") diff --git a/app/src/main/java/com/cappielloantonio/tempo/model/Download.kt b/app/src/main/java/com/cappielloantonio/tempo/model/Download.kt index e5cc34b3..0c54e1cd 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/model/Download.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/model/Download.kt @@ -10,19 +10,17 @@ import kotlinx.parcelize.Parcelize @Keep @Parcelize @Entity(tableName = "download") -class Download(@PrimaryKey override val id: String) : Child(id) { +class Download( + @PrimaryKey override val id: String, @ColumnInfo(name = "playlist_id") - var playlistId: String? = null - + var playlistId: String? = null, @ColumnInfo(name = "playlist_name") - var playlistName: String? = null - + var playlistName: String? = null, @ColumnInfo(name = "download_state", defaultValue = "1") - var downloadState: Int = 0 - + var downloadState: Int = 0, @ColumnInfo(name = "download_uri", defaultValue = "") - var downloadUri: String? = null - + var downloadUri: String? = null, +) : Child(id) { constructor(child: Child) : this(child.id) { parentId = child.parentId isDir = child.isDir @@ -62,5 +60,5 @@ class Download(@PrimaryKey override val id: String) : Child(id) { @Keep data class DownloadStack( var id: String, - var view: String? + var view: String?, ) \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/model/Queue.kt b/app/src/main/java/com/cappielloantonio/tempo/model/Queue.kt index ca2300c2..87840178 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/model/Queue.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/model/Queue.kt @@ -10,20 +10,18 @@ import kotlinx.parcelize.Parcelize @Keep @Parcelize @Entity(tableName = "queue") -class Queue(override val id: String) : Child(id) { +class Queue( + override val id: String, @PrimaryKey @ColumnInfo(name = "track_order") - var trackOrder: Int = 0 - + var trackOrder: Int = 0, @ColumnInfo(name = "last_play") - var lastPlay: Long = 0 - + var lastPlay: Long = 0, @ColumnInfo(name = "playing_changed") - var playingChanged: Long = 0 - + var playingChanged: Long = 0, @ColumnInfo(name = "stream_id") - var streamId: String? = null - + var streamId: String? = null, +) : Child(id) { constructor(child: Child) : this(child.id) { parentId = child.parentId isDir = child.isDir diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/AlbumID3.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/AlbumID3.kt index 3072a3a4..95c67da2 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/AlbumID3.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/AlbumID3.kt @@ -4,38 +4,36 @@ import android.os.Parcelable import androidx.annotation.Keep import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize -import java.time.Instant -import java.time.LocalDate -import java.util.* +import java.util.Date @Keep @Parcelize -open class AlbumID3 : Parcelable { - var id: String? = null - var name: String? = null - var artist: String? = null - var artistId: String? = null +open class AlbumID3( + var id: String? = null, + var name: String? = null, + var artist: String? = null, + var artistId: String? = null, @SerializedName("coverArt") - var coverArtId: String? = null - var songCount: Int? = 0 - var duration: Int? = 0 - var playCount: Long? = 0 - var created: Date? = null - var starred: Date? = null - var year: Int = 0 - var genre: String? = null - var played: Date? = Date(0) - var userRating: Int? = 0 - var recordLabels: List? = null - var musicBrainzId: String? = null - var genres: List? = null - var artists: List? = null - var displayArtist: String? = null - var releaseTypes: List? = null - var moods: List? = null - var sortName: String? = null - var originalReleaseDate: ItemDate? = null - var releaseDate: ItemDate? = null - var isCompilation: Boolean? = null - var discTitles: List? = null -} \ No newline at end of file + var coverArtId: String? = null, + var songCount: Int? = 0, + var duration: Int? = 0, + var playCount: Long? = 0, + var created: Date? = null, + var starred: Date? = null, + var year: Int = 0, + var genre: String? = null, + var played: Date? = Date(0), + var userRating: Int? = 0, + var recordLabels: List? = null, + var musicBrainzId: String? = null, + var genres: List? = null, + var artists: List? = null, + var displayArtist: String? = null, + var releaseTypes: List? = null, + var moods: List? = null, + var sortName: String? = null, + var originalReleaseDate: ItemDate? = null, + var releaseDate: ItemDate? = null, + var isCompilation: Boolean? = null, + var discTitles: List? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/AlbumWithSongsID3.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/AlbumWithSongsID3.kt index 79c56092..8498e777 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/AlbumWithSongsID3.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/AlbumWithSongsID3.kt @@ -7,7 +7,7 @@ import kotlinx.parcelize.Parcelize @Keep @Parcelize -class AlbumWithSongsID3 : AlbumID3(), Parcelable { +class AlbumWithSongsID3( @SerializedName("song") - var songs: List? = null -} \ No newline at end of file + var songs: List? = null, +) : AlbumID3(), Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Artist.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Artist.kt index a13d169d..22aa527b 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Artist.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Artist.kt @@ -7,10 +7,10 @@ import java.util.Date @Keep @Parcelize -class Artist : Parcelable { - var id: String? = null - var name: String? = null - var starred: Date? = null - var userRating: Int? = null - var averageRating: Double? = null -} \ No newline at end of file +class Artist( + var id: String? = null, + var name: String? = null, + var starred: Date? = null, + var userRating: Int? = null, + var averageRating: Double? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ArtistID3.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ArtistID3.kt index a17f4aa3..ccf4ee7e 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ArtistID3.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ArtistID3.kt @@ -4,15 +4,15 @@ import android.os.Parcelable import androidx.annotation.Keep import com.google.gson.annotations.SerializedName import kotlinx.parcelize.Parcelize -import java.util.* +import java.util.Date @Keep @Parcelize -open class ArtistID3 : Parcelable { - var id: String? = null - var name: String? = null +open class ArtistID3( + var id: String? = null, + var name: String? = null, @SerializedName("coverArt") - var coverArtId: String? = null - var albumCount = 0 - var starred: Date? = null -} \ No newline at end of file + var coverArtId: String? = null, + var albumCount: Int = 0, + var starred: Date? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ArtistWithAlbumsID3.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ArtistWithAlbumsID3.kt index c22c8207..2e21e111 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ArtistWithAlbumsID3.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ArtistWithAlbumsID3.kt @@ -7,7 +7,7 @@ import kotlinx.parcelize.Parcelize @Keep @Parcelize -class ArtistWithAlbumsID3 : ArtistID3(), Parcelable { +class ArtistWithAlbumsID3( @SerializedName("album") - var albums: List? = null -} \ No newline at end of file + var albums: List? = null, +) : ArtistID3(), Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Directory.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Directory.kt index 45395ede..f189589e 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Directory.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Directory.kt @@ -8,15 +8,15 @@ import java.util.Date @Keep @Parcelize -class Directory : Parcelable { +class Directory( @SerializedName("child") - var children: List? = null - var id: String? = null + var children: List? = null, + var id: String? = null, @SerializedName("parent") - var parentId: String? = null - var name: String? = null - var starred: Date? = null - var userRating: Int? = null - var averageRating: Double? = null - var playCount: Long? = null -} \ No newline at end of file + var parentId: String? = null, + var name: String? = null, + var starred: Date? = null, + var userRating: Int? = null, + var averageRating: Double? = null, + var playCount: Long? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/DiscTitle.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/DiscTitle.kt index 2910d4bf..32caa8cc 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/DiscTitle.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/DiscTitle.kt @@ -6,7 +6,7 @@ import kotlinx.parcelize.Parcelize @Keep @Parcelize -open class DiscTitle : Parcelable { - var disc: Int? = null - var title: String? = null -} \ No newline at end of file +open class DiscTitle( + var disc: Int? = null, + var title: String? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Genre.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Genre.kt index cb1b7719..1db88c40 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Genre.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Genre.kt @@ -7,9 +7,9 @@ import kotlinx.parcelize.Parcelize @Keep @Parcelize -class Genre : Parcelable { +class Genre( @SerializedName("value") - var genre: String? = null - var songCount = 0 - var albumCount = 0 -} \ No newline at end of file + var genre: String? = null, + var songCount: Int = 0, + var albumCount: Int = 0, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/InternetRadioStation.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/InternetRadioStation.kt index 0d312ce0..07f00c5b 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/InternetRadioStation.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/InternetRadioStation.kt @@ -6,9 +6,9 @@ import kotlinx.parcelize.Parcelize @Keep @Parcelize -class InternetRadioStation : Parcelable { - var id: String? = null - var name: String? = null - var streamUrl: String? = null - var homePageUrl: String? = null -} \ No newline at end of file +class InternetRadioStation( + var id: String? = null, + var name: String? = null, + var streamUrl: String? = null, + var homePageUrl: String? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ItemDate.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ItemDate.kt index 5de2fbc6..385b7fd7 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ItemDate.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ItemDate.kt @@ -9,11 +9,11 @@ import java.util.Locale @Keep @Parcelize -open class ItemDate : Parcelable { - var year: Int? = null - var month: Int? = null - var day: Int? = null - +open class ItemDate( + var year: Int? = null, + var month: Int? = null, + var day: Int? = null, +) : Parcelable { fun getFormattedDate(): String? { if (year == null && month == null && day == null) return null @@ -22,8 +22,7 @@ open class ItemDate : Parcelable { SimpleDateFormat("yyyy", Locale.getDefault()) } else if (day == null) { SimpleDateFormat("MMMM yyyy", Locale.getDefault()) - } - else{ + } else { SimpleDateFormat("MMMM dd, yyyy", Locale.getDefault()) } diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ItemGenre.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ItemGenre.kt index ce164fb6..971809ff 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ItemGenre.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/ItemGenre.kt @@ -6,6 +6,6 @@ import kotlinx.parcelize.Parcelize @Keep @Parcelize -open class ItemGenre : Parcelable { - var name: String? = null -} \ No newline at end of file +open class ItemGenre( + var name: String? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/MusicFolder.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/MusicFolder.kt index 7c277df4..e31bf7c8 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/MusicFolder.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/MusicFolder.kt @@ -6,7 +6,7 @@ import kotlinx.parcelize.Parcelize @Keep @Parcelize -class MusicFolder : Parcelable { - var id: String? = null - var name: String? = null -} \ No newline at end of file +class MusicFolder( + var id: String? = null, + var name: String? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/NowPlayingEntry.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/NowPlayingEntry.kt index e5391872..bd69808c 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/NowPlayingEntry.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/NowPlayingEntry.kt @@ -8,10 +8,9 @@ import kotlinx.parcelize.Parcelize @Parcelize class NowPlayingEntry( @SerializedName("_id") - override val id: String -) : Child(id) { - var username: String? = null - var minutesAgo = 0 - var playerId = 0 - var playerName: String? = null -} \ No newline at end of file + override val id: String, + var username: String? = null, + var minutesAgo: Int = 0, + var playerId: Int = 0, + var playerName: String? = null, +) : Child(id) \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Playlist.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Playlist.kt index 2d85271e..926c2390 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Playlist.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Playlist.kt @@ -7,8 +7,9 @@ import androidx.room.Entity import androidx.room.Ignore import androidx.room.PrimaryKey import com.google.gson.annotations.SerializedName +import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize -import java.util.* +import java.util.Date @Keep @Parcelize @@ -16,27 +17,56 @@ import java.util.* open class Playlist( @PrimaryKey @ColumnInfo(name = "id") - open var id: String -) : Parcelable { + open var id: String, @ColumnInfo(name = "name") - var name: String? = null + var name: String? = null, + @ColumnInfo(name = "duration") + var duration: Long = 0, + @ColumnInfo(name = "coverArt") + var coverArtId: String? = null, +) : Parcelable { @Ignore + @IgnoredOnParcel var comment: String? = null @Ignore + @IgnoredOnParcel var owner: String? = null @Ignore + @IgnoredOnParcel @SerializedName("public") var isUniversal: Boolean? = null @Ignore + @IgnoredOnParcel var songCount: Int = 0 - @ColumnInfo(name = "duration") - var duration: Long = 0 @Ignore + @IgnoredOnParcel var created: Date? = null @Ignore + @IgnoredOnParcel var changed: Date? = null - @ColumnInfo(name = "coverArt") - var coverArtId: String? = null @Ignore + @IgnoredOnParcel var allowedUsers: List? = null + @Ignore + constructor( + id: String, + name: String?, + comment: String?, + owner: String?, + isUniversal: Boolean?, + songCount: Int, + duration: Long, + created: Date?, + changed: Date?, + coverArtId: String?, + allowedUsers: List?, + ) : this(id, name, duration, coverArtId) { + this.comment = comment + this.owner = owner + this.isUniversal = isUniversal + this.songCount = songCount + this.created = created + this.changed = changed + this.allowedUsers = allowedUsers + } } \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PlaylistWithSongs.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PlaylistWithSongs.kt index 92e194c8..350dcbd4 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PlaylistWithSongs.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PlaylistWithSongs.kt @@ -9,8 +9,7 @@ import kotlinx.parcelize.Parcelize @Parcelize class PlaylistWithSongs( @SerializedName("_id") - override var id: String -) : Playlist(id), Parcelable { + override var id: String, @SerializedName("entry") - var entries: List? = null -} \ No newline at end of file + var entries: List? = null, +) : Playlist(id), Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Playlists.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Playlists.kt index 8aa271a4..34079c76 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Playlists.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Playlists.kt @@ -6,5 +6,5 @@ import com.google.gson.annotations.SerializedName @Keep class Playlists( @SerializedName("playlist") - var playlists: List? = null + var playlists: List? = null, ) \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PodcastChannel.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PodcastChannel.kt index 088ed97e..b4d124ff 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PodcastChannel.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PodcastChannel.kt @@ -3,20 +3,21 @@ package com.cappielloantonio.tempo.subsonic.models import android.os.Parcelable import androidx.annotation.Keep import com.google.gson.annotations.SerializedName +import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize @Keep @Parcelize -class PodcastChannel : Parcelable { +class PodcastChannel( @SerializedName("episode") - var episodes: List? = null - var id: String? = null - var url: String? = null - var title: String? = null - var description: String? = null + var episodes: List? = null, + var id: String? = null, + var url: String? = null, + var title: String? = null, + var description: String? = null, @SerializedName("coverArt") - var coverArtId: String? = null - var originalImageUrl: String? = null - var status: String? = null - var errorMessage: String? = null -} \ No newline at end of file + var coverArtId: String? = null, + var originalImageUrl: String? = null, + var status: String? = null, + var errorMessage: String? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PodcastEpisode.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PodcastEpisode.kt index f8893224..fc3fab21 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PodcastEpisode.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/PodcastEpisode.kt @@ -3,37 +3,38 @@ package com.cappielloantonio.tempo.subsonic.models import android.os.Parcelable import androidx.annotation.Keep import com.google.gson.annotations.SerializedName +import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize import java.util.* @Keep @Parcelize -class PodcastEpisode : Parcelable { - var id: String? = null +class PodcastEpisode( + var id: String? = null, @SerializedName("parent") - var parentId: String? = null - var isDir = false - var title: String? = null - var album: String? = null - var artist: String? = null - var year: Int? = null - var genre: String? = null + var parentId: String? = null, + var isDir: Boolean = false, + var title: String? = null, + var album: String? = null, + var artist: String? = null, + var year: Int? = null, + var genre: String? = null, @SerializedName("coverArt") - var coverArtId: String? = null - var size: Long? = null - var contentType: String? = null - var suffix: String? = null - var duration: Int? = null + var coverArtId: String? = null, + var size: Long? = null, + var contentType: String? = null, + var suffix: String? = null, + var duration: Int? = null, @SerializedName("bitRate") - var bitrate: Int? = null - var path: String? = null - var isVideo: Boolean = false - var created: Date? = null - var artistId: String? = null - var type: String? = null - var streamId: String? = null - var channelId: String? = null - var description: String? = null - var status: String? = null - var publishDate: Date? = null -} \ No newline at end of file + var bitrate: Int? = null, + var path: String? = null, + var isVideo: Boolean = false, + var created: Date? = null, + var artistId: String? = null, + var type: String? = null, + var streamId: String? = null, + var channelId: String? = null, + var description: String? = null, + var status: String? = null, + var publishDate: Date? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/RecordLabel.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/RecordLabel.kt index 687f3fd7..52531d90 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/RecordLabel.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/RecordLabel.kt @@ -2,10 +2,11 @@ package com.cappielloantonio.tempo.subsonic.models import android.os.Parcelable import androidx.annotation.Keep +import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize @Keep @Parcelize -open class RecordLabel : Parcelable { - var name: String? = null -} \ No newline at end of file +open class RecordLabel( + var name: String? = null, +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Share.kt b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Share.kt index 83332068..986e4b50 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Share.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/subsonic/models/Share.kt @@ -3,8 +3,9 @@ package com.cappielloantonio.tempo.subsonic.models import android.os.Parcelable import androidx.annotation.Keep import com.google.gson.annotations.SerializedName +import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize -import java.util.* +import java.util.Date @Keep @Parcelize diff --git a/app/src/tempo/java/com/cappielloantonio/tempo/service/MediaLibraryServiceCallback.kt b/app/src/tempo/java/com/cappielloantonio/tempo/service/MediaLibraryServiceCallback.kt index a01a2644..1bc0b15f 100644 --- a/app/src/tempo/java/com/cappielloantonio/tempo/service/MediaLibraryServiceCallback.kt +++ b/app/src/tempo/java/com/cappielloantonio/tempo/service/MediaLibraryServiceCallback.kt @@ -295,11 +295,6 @@ open class MediaLibrarySessionCallback( args: Bundle ): ListenableFuture { - val mediaItemId = args.getString( - MediaConstants.EXTRA_KEY_MEDIA_ID, - session.player.currentMediaItem?.mediaId - ) - when (customCommand.customAction) { CUSTOM_COMMAND_TOGGLE_SHUFFLE_MODE_ON -> { session.player.shuffleModeEnabled = true @@ -398,4 +393,4 @@ open class MediaLibrarySessionCallback( ): ListenableFuture>> { return MediaBrowserTree.search(query) } -} \ No newline at end of file +} diff --git a/app/src/tempo/java/com/cappielloantonio/tempo/service/MediaService.kt b/app/src/tempo/java/com/cappielloantonio/tempo/service/MediaService.kt index 125ef0dd..2ff81ac4 100644 --- a/app/src/tempo/java/com/cappielloantonio/tempo/service/MediaService.kt +++ b/app/src/tempo/java/com/cappielloantonio/tempo/service/MediaService.kt @@ -147,6 +147,7 @@ class MediaService : MediaLibraryService(), SessionAvailabilityListener { player.repeatMode = Preferences.getRepeatMode() } + @Suppress("DEPRECATION") private fun initializeCastPlayer() { if (GoogleApiAvailability.getInstance() .isGooglePlayServicesAvailable(this) == ConnectionResult.SUCCESS diff --git a/app/src/tempo/java/com/cappielloantonio/tempo/util/Flavors.java b/app/src/tempo/java/com/cappielloantonio/tempo/util/Flavors.java index 73c7e43b..1ec0cd92 100644 --- a/app/src/tempo/java/com/cappielloantonio/tempo/util/Flavors.java +++ b/app/src/tempo/java/com/cappielloantonio/tempo/util/Flavors.java @@ -9,6 +9,7 @@ import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GoogleApiAvailability; public class Flavors { + @SuppressWarnings("deprecation") public static void initializeCastContext(Context context) { if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS) CastContext.getSharedInstance(context, ContextCompat.getMainExecutor(context));