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