Jellyfin: Add support for external subs (#1622)
This commit is contained in:
parent
c55f7c62ef
commit
d38be0cf35
@ -6,7 +6,7 @@ ext {
|
||||
extName = 'Jellyfin'
|
||||
pkgNameSuffix = 'all.jellyfin'
|
||||
extClass = '.Jellyfin'
|
||||
extVersionCode = 6
|
||||
extVersionCode = 7
|
||||
libVersion = '13'
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ data class SessionResponse(
|
||||
val Index: Int,
|
||||
val Type: String,
|
||||
val SupportsExternalStream: Boolean,
|
||||
val IsExternal: Boolean,
|
||||
val Language: String? = null,
|
||||
val DisplayTitle: String? = null,
|
||||
val Height: Int? = null,
|
||||
|
@ -351,19 +351,21 @@ class Jellyfin : ConfigurableAnimeSource, AnimeHttpSource() {
|
||||
if (media.Language != null) {
|
||||
if (media.Language == prefSub) {
|
||||
try {
|
||||
subtitleList.add(0, Track(subUrl, media.DisplayTitle!!))
|
||||
if (media.IsExternal) {
|
||||
subtitleList.add(0, Track(subUrl, media.DisplayTitle!!))
|
||||
}
|
||||
} catch (e: Error) {
|
||||
subIndex = media.Index
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
if (media.IsExternal) {
|
||||
subtitleList.add(Track(subUrl, media.DisplayTitle!!))
|
||||
} catch (_: Error) {}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
if (media.IsExternal) {
|
||||
subtitleList.add(Track(subUrl, media.DisplayTitle!!))
|
||||
} catch (_: Error) {}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (media.Language != null && media.Language == prefSub) {
|
||||
@ -387,7 +389,7 @@ class Jellyfin : ConfigurableAnimeSource, AnimeHttpSource() {
|
||||
JFConstants.QUALITIES_LIST.forEach { quality ->
|
||||
if (width < quality.width && height < quality.height) {
|
||||
val url = "$baseUrl/Videos/$id/stream?static=True&api_key=$apiKey"
|
||||
videoList.add(Video(url, "Best", url))
|
||||
videoList.add(Video(url, "Best", url, subtitleTracks = subtitleList))
|
||||
|
||||
return videoList.reversed()
|
||||
} else {
|
||||
@ -419,11 +421,7 @@ class Jellyfin : ConfigurableAnimeSource, AnimeHttpSource() {
|
||||
url.addQueryParameter("h264-deinterlace", "true")
|
||||
url.addQueryParameter("TranscodeReasons", "VideoCodecNotSupported,AudioCodecNotSupported,ContainerBitrateExceedsLimit")
|
||||
|
||||
try {
|
||||
videoList.add(Video(url.toString(), quality.description, url.toString(), subtitleTracks = subtitleList))
|
||||
} catch (_: Error) {
|
||||
videoList.add(Video(url.toString(), quality.description, url.toString()))
|
||||
}
|
||||
videoList.add(Video(url.toString(), quality.description, url.toString(), subtitleTracks = subtitleList))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user