Fix class name collisions

This commit is contained in:
ronaldheft 2022-07-09 15:18:34 -04:00
parent 16ca7460f4
commit affcdea09b

View file

@ -16,7 +16,7 @@ class LocalLibraryItem: Object, Codable {
@Persisted var contentUrl: String @Persisted var contentUrl: String
@Persisted var isInvalid: Bool @Persisted var isInvalid: Bool
@Persisted var mediaType: String @Persisted var mediaType: String
@Persisted var media: MediaType? @Persisted var media: LocalMediaType?
@Persisted var localFiles: List<LocalFile> @Persisted var localFiles: List<LocalFile>
@Persisted var coverContentUrl: String? = nil @Persisted var coverContentUrl: String? = nil
@Persisted var coverAbsolutePath: String? = nil @Persisted var coverAbsolutePath: String? = nil
@ -26,6 +26,7 @@ class LocalLibraryItem: Object, Codable {
@Persisted var serverUserId: String? = nil @Persisted var serverUserId: String? = nil
@Persisted var libraryItemId: String? = nil @Persisted var libraryItemId: String? = nil
} }
class LocalMediaItem: Object, Codable { class LocalMediaItem: Object, Codable {
@Persisted var id: String @Persisted var id: String
@Persisted var name: String @Persisted var name: String
@ -35,35 +36,37 @@ class LocalMediaItem: Object, Codable {
@Persisted var simplePath: String @Persisted var simplePath: String
@Persisted var basePath: String @Persisted var basePath: String
@Persisted var absolutePath: String @Persisted var absolutePath: String
@Persisted var audioTracks: List<AudioTrack> @Persisted var audioTracks: List<LocalAudioTrack>
@Persisted var localFiles: List<LocalFile> @Persisted var localFiles: List<LocalFile>
@Persisted var coverContentUrl: String? = "" @Persisted var coverContentUrl: String? = ""
@Persisted var coverAbsolutePath: String? = "" @Persisted var coverAbsolutePath: String? = ""
} }
class MediaType: Object, Codable {
class LocalMediaType: Object, Codable {
@Persisted var libraryItemId: String? = "" @Persisted var libraryItemId: String? = ""
@Persisted var metadata: Metadata? @Persisted var metadata: LocalMetadata?
@Persisted var coverPath: String? = "" @Persisted var coverPath: String? = ""
@Persisted var tags: List<String?> @Persisted var tags: List<String?>
@Persisted var audioFiles: List<AudioFile> @Persisted var audioFiles: List<LocalAudioFile>
@Persisted var chapters: List<Chapter> @Persisted var chapters: List<LocalChapter>
@Persisted var tracks: List<AudioTrack> @Persisted var tracks: List<LocalAudioTrack>
@Persisted var size: Int64? = nil @Persisted var size: Int64? = nil
@Persisted var duration: Double? = nil @Persisted var duration: Double? = nil
@Persisted var episodes: List<PodcastEpisode> @Persisted var episodes: List<LocalPodcastEpisode>
@Persisted var autoDownloadEpisodes: Bool? = nil @Persisted var autoDownloadEpisodes: Bool? = nil
} }
class Metadata: Object, Codable {
class LocalMetadata: Object, Codable {
@Persisted var title: String @Persisted var title: String
@Persisted var subtitle: String? = "" @Persisted var subtitle: String? = ""
@Persisted var authors: List<Author> @Persisted var authors: List<LocalAuthor>
@Persisted var narrators: List<String?> @Persisted var narrators: List<String?>
@Persisted var genres: List<String?> @Persisted var genres: List<String?>
@Persisted var publishedYear: String? = "" @Persisted var publishedYear: String? = ""
@Persisted var publishedDate: String? = "" @Persisted var publishedDate: String? = ""
@Persisted var publisher: String? = "" @Persisted var publisher: String? = ""
// I think calling the below variable description conflicts with some public variables declared in some of the Pods we use, so it's desc. ¯\_()_/¯ // I think calling the below variable description conflicts with some public variables declared in some of the Pods we use, so it's desc. ¯\_()_/¯
@Persisted final var description: String @Persisted final var desc: String
@Persisted var isbn: String? = "" @Persisted var isbn: String? = ""
@Persisted var asin: String? = "" @Persisted var asin: String? = ""
@Persisted var language: String? = "" @Persisted var language: String? = ""
@ -74,7 +77,8 @@ class Metadata: Object, Codable {
@Persisted var seriesName: String? = "" @Persisted var seriesName: String? = ""
@Persisted var feedUrl: String? = "" @Persisted var feedUrl: String? = ""
} }
class PodcastEpisode: Object, Codable {
class LocalPodcastEpisode: Object, Codable {
@Persisted var id: String @Persisted var id: String
@Persisted var index: Int @Persisted var index: Int
@Persisted var episode: String? = "" @Persisted var episode: String? = ""
@ -82,47 +86,53 @@ class PodcastEpisode: Object, Codable {
@Persisted var title: String @Persisted var title: String
@Persisted var subtitle: String? = "" @Persisted var subtitle: String? = ""
@Persisted var escription: String? = "" @Persisted var escription: String? = ""
@Persisted var audioFile: AudioFile? = nil @Persisted var audioFile: LocalAudioFile? = nil
@Persisted var audioTrack: AudioTrack? = nil @Persisted var audioTrack: LocalAudioTrack? = nil
@Persisted var duration: Double @Persisted var duration: Double
@Persisted var size: Int64 @Persisted var size: Int64
// @Persisted var serverEpisodeId: String? // @Persisted var serverEpisodeId: String?
} }
class AudioFile: Object, Codable {
class LocalAudioFile: Object, Codable {
@Persisted var index: Int @Persisted var index: Int
@Persisted var ino: String @Persisted var ino: String
@Persisted var metadata: FileMetadata? @Persisted var metadata: LocalFileMetadata?
} }
class Author: Object, Codable {
class LocalAuthor: Object, Codable {
@Persisted var id: String @Persisted var id: String
@Persisted var name: String @Persisted var name: String
@Persisted var coverPath: String? = "" @Persisted var coverPath: String? = ""
} }
class Chapter: Object, Codable {
class LocalChapter: Object, Codable {
@Persisted var id: Int @Persisted var id: Int
@Persisted var start: Double @Persisted var start: Double
@Persisted var end: Double @Persisted var end: Double
@Persisted var title: String? = nil @Persisted var title: String? = nil
} }
class AudioTrack: Object, Codable {
class LocalAudioTrack: Object, Codable {
@Persisted var index: Int? = nil @Persisted var index: Int? = nil
@Persisted var startOffset: Double? = nil @Persisted var startOffset: Double? = nil
@Persisted var duration: Double @Persisted var duration: Double
@Persisted var title: String? = "" @Persisted var title: String? = ""
@Persisted var contentUrl: String? = "" @Persisted var contentUrl: String? = ""
@Persisted var mimeType: String @Persisted var mimeType: String
@Persisted var metadata: FileMetadata? = nil @Persisted var metadata: LocalFileMetadata? = nil
@Persisted var isLocal: Bool @Persisted var isLocal: Bool
@Persisted var localFileId: String? = "" @Persisted var localFileId: String? = ""
// var audioProbeResult: AudioProbeResult? // Needed for local playback. Requires local FFMPEG? Not sure how doable this is on iOS // var audioProbeResult: AudioProbeResult? // Needed for local playback. Requires local FFMPEG? Not sure how doable this is on iOS
@Persisted var serverIndex: Int? = nil @Persisted var serverIndex: Int? = nil
} }
class FileMetadata: Object, Codable {
class LocalFileMetadata: Object, Codable {
@Persisted var filename: String @Persisted var filename: String
@Persisted var ext: String @Persisted var ext: String
@Persisted var path: String @Persisted var path: String
@Persisted var relPath: String @Persisted var relPath: String
} }
class LocalFile: Object, Codable { class LocalFile: Object, Codable {
@Persisted var id: String @Persisted var id: String
@Persisted var filename: String? = "" @Persisted var filename: String? = ""
@ -133,6 +143,7 @@ class LocalFile: Object, Codable {
@Persisted var mimeType: String? = "" @Persisted var mimeType: String? = ""
@Persisted var size: Int64 @Persisted var size: Int64
} }
class LocalMediaProgress: Object, Codable { class LocalMediaProgress: Object, Codable {
@Persisted var id: String @Persisted var id: String
@Persisted var localLibraryItemId: String @Persisted var localLibraryItemId: String