Compare commits

...

3 Commits

Author SHA1 Message Date
thumb2086
ffb1988d5c
Merge 07031cb564 into 0ac949dc1b 2026-02-14 02:00:58 -05:00
Kingkor Roy Tirtho
0ac949dc1b fix(android): build not working due to 2026-02-12 10:57:36 +06:00
thumb2086
07031cb564 fix: prevent metadata corruption for weba and flac files
- Skip metadata writing for flac files to prevent file corruption
- FLAC files have strict header requirements where writing metadata after download can corrupt the sync code and make files unplayable
- Update download_manager_provider.dart to check for both weba and flac extensions
- Update server/routes/playback.dart to check for both weba and flac extensions
- Add explanatory comments documenting why metadata writing is skipped for these formats
- Refactor extension checking to use variable assignment for clarity
2025-11-25 23:31:16 +08:00
5 changed files with 21 additions and 11 deletions

View File

@ -27,6 +27,7 @@
-keep class org.schabi.newpipe.extractor.timeago.patterns.** { *; }
-keep class org.mozilla.javascript.** { *; }
-keep class org.mozilla.classfile.ClassFileWriter
-dontwarn com.google.re2j.**
-dontwarn org.mozilla.javascript.tools.**
-dontwarn javax.script.AbstractScriptEngine

View File

@ -239,7 +239,11 @@ class DownloadManagerNotifier extends Notifier<List<DownloadTask>> {
return;
}
if (container.getFileExtension() == "weba") return;
// Skip metadata writing for weba and flac to prevent file corruption
// FLAC files have strict header requirements and writing metadata after
// download can corrupt the sync code and make files unplayable
final extension = container.getFileExtension();
if (extension == "weba" || extension == "flac") return;
final imageBytes = await ServiceUtils.downloadImage(
(task.track.album.images).asUrlString(

View File

@ -247,7 +247,11 @@ class ServerPlaybackRoutes {
await trackPartialCacheFile.rename(trackCacheFile.path);
if (track.qualityPreset!.getFileExtension() == "weba") return;
// Skip metadata writing for weba and flac to prevent file corruption
// FLAC files have strict header requirements and writing metadata after
// download can corrupt the sync code and make files unplayable
final extension = track.qualityPreset!.getFileExtension();
if (extension == "weba" || extension == "flac") return;
final imageBytes = await ServiceUtils.downloadImage(
track.query.album.images.asUrlString(

View File

@ -745,11 +745,11 @@ packages:
dependency: transitive
description:
path: "."
ref: master
resolved-ref: "922f9f9eafd8b501da83dca67d56b2887fa8f916"
url: "https://github.com/TiffApps/fk_user_agent.git"
ref: HEAD
resolved-ref: "458046cd9a88924e5074d96ba45397219d53b230"
url: "https://github.com/maeltoukap/fk_user_agent.git"
source: git
version: "2.1.1"
version: "2.1.0"
fluentui_system_icons:
dependency: "direct main"
description:
@ -946,9 +946,9 @@ packages:
dependency: "direct main"
description:
path: "."
ref: ab3ff415114b7b43593e6ee718ad3d760af18350
ref: HEAD
resolved-ref: ab3ff415114b7b43593e6ee718ad3d760af18350
url: "https://github.com/KRTirtho/flutter_new_pipe_extractor.git"
url: "https://github.com/KRTirtho/flutter_new_pipe_extractor"
source: git
version: "0.1.0"
flutter_plugin_android_lifecycle:
@ -1189,7 +1189,7 @@ packages:
description:
path: "."
ref: main
resolved-ref: "32828156bc111d147709f8d644804227bbdfe8f1"
resolved-ref: d85dd429241d464a8b5b0c2b3d870143eeba8b46
url: "https://github.com/KRTirtho/hetu_spotube_plugin.git"
source: git
version: "0.0.2"

View File

@ -121,8 +121,7 @@ dependencies:
ref: 4e5310e14af74bdbb51e2a4766e66d6c6a2562a8
flutter_new_pipe_extractor:
git:
url: https://github.com/KRTirtho/flutter_new_pipe_extractor.git
ref: ab3ff415114b7b43593e6ee718ad3d760af18350
url: https://github.com/KRTirtho/flutter_new_pipe_extractor
http_parser: ^4.1.2
collection: any
archive: ^4.0.7
@ -240,6 +239,8 @@ flutter:
- packages/hetu_std/assets/bytecode/std.out
- packages/hetu_otp_util/assets/bytecode/otp_util.out
- packages/hetu_spotube_plugin/assets/bytecode/spotube_plugin.out
# NewPipe binaries (desktop only)
- packages/flutter_new_pipe_extractor/assets/
fonts:
- family: RadixIcons
fonts: