[PR #13760] [MERGED] Cleanup extracted files #13693

Closed
opened 2026-02-07 07:17:31 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/13760
Author: @Shadowghost
Created: 3/23/2025
Status: Merged
Merged: 4/3/2025
Merged by: @crobibero

Base: masterHead: cleanup-extracted-files


📝 Commits (10+)

  • 0f99809 Cleanup extracted files
  • fc4043a Pagination and fixes
  • 5a10d38 Add migration for attachments to MigrateLibraryDb
  • 13f39ca Unify attachment handling
  • 75c2dae Don't extract again if files were already extracted
  • 46e5664 Fix MKS attachment extraction
  • 105c3b1 Always run full extraction on mks
  • a5695b6 Don't try to extract mjpeg streams as attachments
  • 36ffb2c Fallback to check if attachments were extracted to cache folder
  • 6d49449 Fixup

📊 Changes

17 files changed (+2385 additions, -404 deletions)

View changed files

📝 Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs (+38 -3)
📝 Emby.Server.Implementations/Library/LibraryManager.cs (+17 -0)
📝 Emby.Server.Implementations/Library/PathManager.cs (+38 -2)
📝 Jellyfin.Server/Migrations/MigrationRunner.cs (+1 -0)
📝 Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs (+66 -0)
Jellyfin.Server/Migrations/Routines/MoveExtractedFiles.cs (+299 -0)
📝 MediaBrowser.Controller/IO/IPathManager.cs (+32 -0)
📝 MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs (+6 -2)
📝 MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs (+27 -20)
📝 MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs (+119 -299)
📝 MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs (+6 -27)
📝 MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs (+3 -8)
📝 MediaBrowser.Model/Entities/MediaAttachment.cs (+39 -41)
📝 src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/AttachmentStreamInfo.cs (+1 -1)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250331182844_FixAttachmentMigration.Designer.cs (+1657 -0)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250331182844_FixAttachmentMigration.cs (+36 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/JellyfinDbModelSnapshot.cs (+0 -1)

📄 Description

Changes

  • Save extracted subtitles and attachments in a better folder structure based on mediasourceid
  • Move existing files to new structure
  • Remove leftover files
  • Add purging of extracted files when items get removed from the database
  • Simplify attachment extraction
  • Exclude mjpeg attachments from extraction since those can't be extracted with the ffmpeg attachment dumper

Fixes #12427
Fixes #13522


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/13760 **Author:** [@Shadowghost](https://github.com/Shadowghost) **Created:** 3/23/2025 **Status:** ✅ Merged **Merged:** 4/3/2025 **Merged by:** [@crobibero](https://github.com/crobibero) **Base:** `master` ← **Head:** `cleanup-extracted-files` --- ### 📝 Commits (10+) - [`0f99809`](https://github.com/jellyfin/jellyfin/commit/0f998092c840645da68fe88707d1fa6b3d60c1ca) Cleanup extracted files - [`fc4043a`](https://github.com/jellyfin/jellyfin/commit/fc4043abb1b18175046eedf12480d25d761c1857) Pagination and fixes - [`5a10d38`](https://github.com/jellyfin/jellyfin/commit/5a10d3839b0ffec29dd51bb7a98f7e795d10da88) Add migration for attachments to MigrateLibraryDb - [`13f39ca`](https://github.com/jellyfin/jellyfin/commit/13f39ca0d9cea797c908ee06dca406847c28e85c) Unify attachment handling - [`75c2dae`](https://github.com/jellyfin/jellyfin/commit/75c2daea100294510d0e4230a5ac308ab4ae74f7) Don't extract again if files were already extracted - [`46e5664`](https://github.com/jellyfin/jellyfin/commit/46e5664dac178310621219ed5acb99282ab87234) Fix MKS attachment extraction - [`105c3b1`](https://github.com/jellyfin/jellyfin/commit/105c3b1a8949d910f425b4d0b0798b13469e9e81) Always run full extraction on mks - [`a5695b6`](https://github.com/jellyfin/jellyfin/commit/a5695b66573b8fffece86820353bdfe8358d37fc) Don't try to extract mjpeg streams as attachments - [`36ffb2c`](https://github.com/jellyfin/jellyfin/commit/36ffb2c29ccc2cdce1b3624af88b595754487080) Fallback to check if attachments were extracted to cache folder - [`6d49449`](https://github.com/jellyfin/jellyfin/commit/6d49449894e8f39b5761c5e9a72d6c4ef6456853) Fixup ### 📊 Changes **17 files changed** (+2385 additions, -404 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs` (+38 -3) 📝 `Emby.Server.Implementations/Library/LibraryManager.cs` (+17 -0) 📝 `Emby.Server.Implementations/Library/PathManager.cs` (+38 -2) 📝 `Jellyfin.Server/Migrations/MigrationRunner.cs` (+1 -0) 📝 `Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs` (+66 -0) ➕ `Jellyfin.Server/Migrations/Routines/MoveExtractedFiles.cs` (+299 -0) 📝 `MediaBrowser.Controller/IO/IPathManager.cs` (+32 -0) 📝 `MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs` (+6 -2) 📝 `MediaBrowser.Controller/MediaEncoding/IAttachmentExtractor.cs` (+27 -20) 📝 `MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs` (+119 -299) 📝 `MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs` (+6 -27) 📝 `MediaBrowser.MediaEncoding/Transcoding/TranscodeManager.cs` (+3 -8) 📝 `MediaBrowser.Model/Entities/MediaAttachment.cs` (+39 -41) 📝 `src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/AttachmentStreamInfo.cs` (+1 -1) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250331182844_FixAttachmentMigration.Designer.cs` (+1657 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250331182844_FixAttachmentMigration.cs` (+36 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/JellyfinDbModelSnapshot.cs` (+0 -1) </details> ### 📄 Description **Changes** * Save extracted subtitles and attachments in a better folder structure based on mediasourceid * Move existing files to new structure * Remove leftover files * Add purging of extracted files when items get removed from the database * Simplify attachment extraction * Exclude `mjpeg` attachments from extraction since those can't be extracted with the ffmpeg attachment dumper Fixes #12427 Fixes #13522 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:17:31 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#13693