Skip to content

Commit

Permalink
fix: make xtream live use ts format as much as possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyroid committed Apr 19, 2024
1 parent 30c0a46 commit 4dd1649
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ internal class PlaylistRepositoryImpl @Inject constructor(
if (preferences.keepFavouriteAndHidden == PlaylistStrategy.KEEP_FAVOURITE_AND_HIDDEN) {
streamDao.mergeUnfavouriteOrUnhiddenIfNeededByPlaylistUrl(url)
}

if (epgUrl != null) {

}
}

override suspend fun xtreamOrThrow(
Expand All @@ -198,6 +202,10 @@ internal class PlaylistRepositoryImpl @Inject constructor(
port
) = xtreamParser.getXtreamOutput(input)

// we like ts but not m3u8.
val liveContainerExtension = if ("ts" in allowedOutputFormats) "ts"
else allowedOutputFormats.firstOrNull()?: "ts"

val livePlaylist = XtreamInput.encodeToPlaylistUrl(
input = input.copy(type = DataSource.Xtream.TYPE_LIVE),
serverProtocol = serverProtocol,
Expand Down Expand Up @@ -280,7 +288,7 @@ internal class PlaylistRepositoryImpl @Inject constructor(
password = password,
playlistUrl = livePlaylist.url,
category = liveCategories.find { it.categoryId == current.categoryId }?.categoryName.orEmpty(),
containerExtension = allowedOutputFormats.first()
containerExtension = liveContainerExtension
)
}

Expand Down

0 comments on commit 4dd1649

Please sign in to comment.