Commit graph

71 commits

Author SHA1 Message Date
Hoshino Lina
2bfd21decf Always extract attachments individually
Since e627c723, attachments can be extracted by filename in
one ffmpeg command. This makes the auto-filename codepath redundant.

Letting ffmpeg extract all attachments is broken in ffmpeg upstream.
This was worked around in jellyfin/jellyfin-ffmpeg#720 but affects
distributions that do not use jellyfin-ffmpeg.

Since there is no good reason to keep this codepath, just delete it.
This obsoletes the above ffmpeg patch and should be more robust in
the future, since Jellyfin no longer depends on guessing exactly
what behavior ffmpeg has when constructing, allowing, or denying
attachment filenames.
2026-11-01 18:35:18 +09:00
Cody Robibero
9ba91d4583 Normalize fix, apply in more places 2026-08-20 18:10:50 -04:00
Shadowghost
4cc69f4be0 Apply review suggestions 2026-07-21 14:30:55 +02:00
Shadowghost
1a45fc82b5 Sanitize media attachment and lyric paths against traversal 2026-07-17 17:07:27 +02:00
Shadowghost
e627c723e2 Extract attachments in one ffmpeg command when dumping 2026-05-23 22:41:44 +02:00
jakobkukla
37350282cc Run tree-wide dotnet format 2026-05-21 20:48:41 +02:00
Tim Eisele
a9865367d8
Safeguard against invalid GUIDs (#16813)
Safeguard against invalid GUIDs
2026-05-12 18:12:54 +02:00
Tim Eisele
6ea77f484d
Fix attachment extraction of files without video or audio stream (#16312)
* Fix attachment extraction of files without video or audio stream

* Apply review suggestions
2026-03-29 12:38:01 +02:00
Bond-009
0c3ba30de2
Cleanup file related code (#14023) 2025-05-04 08:40:34 -06:00
Tim Eisele
9092130350
Optimize migrations (#13855) 2025-04-26 09:36:17 -06:00
Tim Eisele
596b635511
Cleanup extracted files (#13760)
* Cleanup extracted files

* Pagination and fixes

* Add migration for attachments to MigrateLibraryDb

* Unify attachment handling

* Don't extract again if files were already extracted

* Fix MKS attachment extraction

* Always run full extraction on mks

* Don't try to extract mjpeg streams as attachments

* Fallback to check if attachments were extracted to cache folder

* Fixup
2025-04-03 09:17:14 -06:00
dmitrylyzo
84b20afe1f Backport pull request #12575 from jellyfin/release-10.9.z
Fix subtitle and attachment extraction when input path contains quotes

Original-merge: 3c3ebe8344

Merged-by: Bond-009 <bond.009@outlook.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2024-09-07 18:09:54 -04:00
gnattu
2fd9418af0 Backport pull request #12443 from jellyfin/release-10.9.z
Check attachment path for null before use

Original-merge: 122da8f447

Merged-by: Bond-009 <bond.009@outlook.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2024-08-25 02:46:36 -04:00
gnattu
c4b7c91f3a Backport pull request #11812 from jellyfin/release-10.9.z
Extract media attachment one by one if the filename appears to be a path

Original-merge: 45e8872cc0

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2024-06-01 18:41:00 -04:00
Mark Cilia Vincenti
af74aa35d7
Clean up synchronization (#11458) 2024-05-05 19:21:54 -06:00
Cody Robibero
814fc6864d Specify file as concat when extracting attachments 2024-03-08 18:10:31 -07:00
Attila Szakacs
8d40d431e8
Extract and cache all media attachments in bulk (#11029)
Similar to https://github.com/jellyfin/jellyfin/pull/10884

---

Jellyfin clients need fonts for subtitles, and each font is a separate
attachment, which causes a lot of re-reads of the file. Certain contents,
like anime in a lot of cases, contain 50-80 different attachments.

Spawning 80 ffmpeg processes at the same time on the same file might
cause swapping on slower HDDs and can bring disk subsystem to a crawl.

(For more info, see https://github.com/jellyfin/jellyfin/3215)

This change helps a lot in this scenario.

Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
2024-03-03 13:33:54 -07:00
Mark Cilia Vincenti
d1677dc680 AsyncKeyedLock migration 2024-01-03 16:47:25 +01:00
Bond_009
4757ce105b Use Process.WaitForExitAsync added in .NET 5 2023-10-10 00:18:50 +02:00
Bond_009
b176beb88e Reduce string allocations
Some simple changes to reduce the number of allocated strings
2023-10-06 01:04:25 +02:00
Stepan Goremykin
910617bbc3 Remove redundant 'else' keywords 2023-04-06 19:38:34 +02:00
Stepan Goremykin
08ce477226 Fix duplicate properties in message template warning 2023-04-06 19:17:28 +02:00
Róbert Örn Ketilsson
ef3868ff50 Backport pull request #9178 from jellyfin/release-10.8.z
Escape the path to pass as a command line argument

Original-merge: 09f1c7f535

Merged-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com>

Backported-by: crobibero <cody@robibe.ro>
2023-03-09 19:29:39 -05:00
Bond_009
b366dc2e6e Use ArgumentException.ThrowIfNullOrEmpty 2022-12-07 16:43:59 +01:00
Bond_009
c7d50d640e Replace == null with is null 2022-12-05 15:00:20 +01:00
Bond_009
a9a5fcde81 Use ArgumentNullException.ThrowIfNull helper method
Did a simple search/replace on the whole repo (except the RSSDP project)
This reduces LOC and should improve performance (methods containing a throw statement don't get inlined)

```
if \((\w+) == null\)
\s+\{
\s+throw new ArgumentNullException\((.*)\);
\s+\}
```

```
ArgumentNullException.ThrowIfNull($1);
```
2022-10-06 20:21:23 +02:00
Nils Fürniß
d7d36a102a
Fix releasing lock 2022-03-22 19:17:49 +01:00
Nils Fürniß
b4bb82b6d7
Improve code 2022-03-22 19:17:48 +01:00
Nils Fürniß
6904edf68c
add extracting attachments from external subs 2022-03-22 19:17:48 +01:00
Nils Fürniß
ab40554759
add extracting attachments for ffmpeg to burn subs 2022-02-10 01:01:08 +01:00
Cody Robibero
7bfc6b5679 Remove more warnings 2021-12-27 07:38:06 -07:00
Bond_009
1d19a5be61 Fix some warnings
down to 580
2021-11-09 22:29:33 +01:00
Bond_009
e3dac4fda2 Use async FileStreams where it makes sense 2021-09-02 14:02:04 +02:00
Bond_009
26d7fc8280 Enable nullable reference types for MediaBrowser.MediaEncoding.Subtitles 2021-05-20 22:10:19 +02:00
Joshua M. Boniface
a6199f821b
Merge pull request #4169 from stanionascu/bdiso-playback
Playback (direct-stream/transcode) of BDISO/BDAV containers
2020-12-01 22:36:04 -05:00
crobibero
e82829c444 Fix nullability errors in MediaBrowser.MediaEncoding 2020-11-13 09:01:55 -07:00
Stanislav Ionascu
cd4641dca0 Remove PlayableStreamFileNames as unused
Since ffmpeg can play and transcode ISO files and BDMV folders directly,
there's no use of that property.
2020-10-01 22:20:34 +02:00
Stanislav Ionascu
3ad6232973 Add probe / direct-stream / transcoding support for BluRays
This commit (and ffmpeg built with libbluray support), adds support
for playback of bluray images (bd-iso) and bluray folders.
2020-10-01 21:59:57 +02:00
Bond_009
ab2147751f Make MediaBrowser.MediaEncoding warnings free 2020-08-20 12:16:24 +02:00
Bond-009
18efa25a6f Enable TreatWarningsAsErrors for MediaBrowser.MediaEncoding 2020-08-04 16:20:52 +02:00
telans
3d9049ef08
fix SA1508 2020-06-15 10:45:55 +12:00
crobibero
44957c5a9a Use typed logger where possible 2020-06-05 18:15:56 -06:00
Mark Monteiro
4113288278 Fix style issues 2020-04-11 13:46:31 -04:00
Mark Monteiro
7152b55747 Use a separate line for each property initializer 2020-04-11 13:28:21 -04:00
Mark Monteiro
e0f40f57d8 Merge remote-tracking branch 'upstream/master' into remove-common-process 2020-04-03 20:22:03 -04:00
Mark Monteiro
0e195d2e49 Add missing call to ConfigureAwait() 2020-04-03 20:20:55 -04:00
Mark Monteiro
d705931e81 Dispose of process correctly in AttachmentExtractor 2020-03-27 01:42:28 +01:00
Mark Monteiro
48bbcbb426 Use WaitForExitAsync extension method in AttachmentExtractor 2020-03-27 01:09:25 +01:00
Bond_009
e9d1eabd53 Remove unused usings 2020-03-24 16:12:06 +01:00
Bond_009
0d6a4c2909 Fix build 2020-01-11 00:08:47 +01:00