mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 13:38:13 -08:00
fix: Improve sanitizing for trickplay (#158)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
ddb71ef835
commit
df7002d990
2 changed files with 9 additions and 3 deletions
|
|
@ -906,10 +906,16 @@ class JellyService {
|
||||||
|
|
||||||
if (server == null) return null;
|
if (server == null) return null;
|
||||||
|
|
||||||
final lines = response.bodyString.split('\n')..removeWhere((element) => element.startsWith('#'));
|
final sanitizedUrls = response.bodyString
|
||||||
|
.split('\n')
|
||||||
|
.where((line) => line.isNotEmpty && !line.startsWith('#'))
|
||||||
|
.map((line) => line.trim())
|
||||||
|
.map((line) => Uri.parse(line).toString())
|
||||||
|
.toList();
|
||||||
|
|
||||||
return response.copyWith(
|
return response.copyWith(
|
||||||
body: trickPlayModel.copyWith(
|
body: trickPlayModel.copyWith(
|
||||||
images: lines
|
images: sanitizedUrls
|
||||||
.map(
|
.map(
|
||||||
(e) => joinAll([server, 'Videos/${item.id}/Trickplay/${trickPlayModel.width}', e]),
|
(e) => joinAll([server, 'Videos/${item.id}/Trickplay/${trickPlayModel.width}', e]),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -457,7 +457,7 @@ class SyncNotifier extends StateNotifier<SyncSettingsModel> {
|
||||||
try {
|
try {
|
||||||
if (!skipDownload && currentTask.task == null) {
|
if (!skipDownload && currentTask.task == null) {
|
||||||
final downloadTask = DownloadTask(
|
final downloadTask = DownloadTask(
|
||||||
url: downloadString,
|
url: Uri.parse(downloadString).toString(),
|
||||||
directory: syncItem.directory.path,
|
directory: syncItem.directory.path,
|
||||||
filename: syncItem.videoFileName,
|
filename: syncItem.videoFileName,
|
||||||
updates: Updates.statusAndProgress,
|
updates: Updates.statusAndProgress,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue