gudvardur 0 Posted September 12, 2025 Posted September 12, 2025 Hi all, I have two Libraries, TV Shows and Movies... Under each, I had two folder locations.... Both of that folder locations sometimes (often) had the same content... Now I removed one of the folder locations from each library so now there is only one folder location in each Library... However, Emby still keeps versions of older content that existed in the removed location and I'm unable to play any content unless I select the other version... I've tried rescaning both libraries... I've tried to refresh metadata and allow it to overwrite... neither of those seem to work... How can I remove all versions that point to this old location?
Luke 42077 Posted September 12, 2025 Posted September 12, 2025 HI there, can you please provide a specific example? How to Report a Problem Thanks !
gudvardur 0 Posted September 12, 2025 Author Posted September 12, 2025 Sure thing... For example this specific episode I can't play unless I Select the lower version that is located in /opt/media/rikflix/tv, the upper version was located in /opt/media/nesral/tv I had both /opt/media/rikflix/tv and /opt/media/nesral/tv in the Folder list below... and this episode (obove) existed in both folders... This picture below reflects how the Library is currently configured... But then I needed to remove /opt/media/nesral/tv and now I'm unable to play this episode (And many other TV shows that existed on both locations), I can play this episode if I select the lower version like shown in the top picture that points to /opt/media/rikflix/tv.....
gudvardur 0 Posted September 12, 2025 Author Posted September 12, 2025 From embyserver logs... 3520268 -bufsize:v:0 7040536 -sc_threshold:v:0 0 -keyint_min:v:0 72 -r:v:0 23.976024627685547 -pix_fmt:v:0 yuv420p -preset:v:0 veryfast -profile:v:0 high -x264opts:v:0 "subme=0:me_range=4:rc_lookahead=10:partitions=none" -crf:v:0 23 -c:a:0 aac -ab:a:0 192000 -ac:a:0 2 -metadata:s:a:0 language=eng -filter:a:0 "volume=2" -disposition:a:0 default -max_delay 5000000 -avoid_negative_ts disabled -f segment -map_metadata -1 -map_chapters -1 -segment_format mpegts -segment_list "/var/lib/emby/transcoding-temp/C16CFE/C16CFE.m3u8" -segment_list_type m3u8 -segment_time 00:00:03.000 -segment_start_number 0 -individual_header_trailer 0 -write_header_trailer 0 -segment_write_temp 1 "/var/lib/emby/transcoding-temp/C16CFE/C16CFE_%d.ts" 13:02:04.101 ffmpeg version 5.1-emby_2023_06_25 Copyright (c) 2000-2022 the FFmpeg developers and softworkz for Emby LLC 13:02:04.101 built with gcc 10.3.0 (crosstool-NG 1.25.0) 13:02:04.101 Execution Date: 2025-09-12 13:02:04 13:02:04.105 /opt/media/nesral/tv/Star Trek - Strange New Worlds/Season 03/Star Trek - Strange New Worlds - s03e02 - Wedding Bell Blues - HDTV-1080p.mkv: No such file or directory 13:02:04.105 EXIT
gudvardur 0 Posted September 12, 2025 Author Posted September 12, 2025 So bottom line, how can I get rid of all versions that point to the old location /opt/media/nesral/tv from my server? And keep /opt/media/rikkflix/tv version...
gudvardur 0 Posted September 15, 2025 Author Posted September 15, 2025 Anyone have suggestion how to remove the extra version that does not exist on disk anymore?
Luke 42077 Posted October 2, 2025 Posted October 2, 2025 @gudvardurcan you try removing the whole star trek folder from your library, then run a library scan, and then add the star trek folder back? Please see if that helps. Thanks !
Solution gudvardur 0 Posted October 5, 2025 Author Solution Posted October 5, 2025 Solution I ended up doing... Step 1 - Stop Service Stop emby-server service Step 2 - Backup Do full backup of /var/lib/emby Step 3 - Delete unwanted versions sqlite3 /var/lib/emby/data/library.db " PRAGMA foreign_keys = OFF; -- Remove streams linked to deleted paths DELETE FROM MediaStreams2 WHERE Path LIKE '/opt/media/nesral/tv%' OR Path LIKE '/opt/media/nesral/movies%'; -- Remove dependents whose parent media has a nesral path DELETE FROM ItemExtradata WHERE ItemId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%'); DELETE FROM ItemLinks2 WHERE ItemId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%') OR LinkedId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%'); DELETE FROM ItemPeople2 WHERE ItemId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%'); DELETE FROM Chapters3 WHERE ItemId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%'); DELETE FROM ImportedCollections WHERE ItemId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%'); DELETE FROM UserItemShares WHERE ItemId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%'); DELETE FROM AncestorIds2 WHERE ItemId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%') OR AncestorId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%'); DELETE FROM ListItems WHERE ListId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%') OR ListItemId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%'); DELETE FROM SyncJobItems2 WHERE ItemId IN (SELECT Id FROM MediaItems WHERE Path LIKE '/opt/media/nesral/%' OR Images LIKE '%/opt/media/nesral/%'); -- Now remove the main media entries DELETE FROM MediaItems WHERE Path LIKE '/opt/media/nesral/tv%' OR Path LIKE '/opt/media/nesral/movies%' OR Images LIKE '%/opt/media/nesral/tv%' OR Images LIKE '%/opt/media/nesral/movies%'; PRAGMA foreign_keys = ON; VACUUM; ANALYZE; " Of course path could be something else that suits you... Step 4 - Check if anything is left sqlite3 /var/lib/emby/data/library.db " SELECT COUNT(*) FROM MediaItems WHERE Path LIKE '%/opt/media/nesral%'; SELECT COUNT(*) FROM MediaItems WHERE Images LIKE '%/opt/media/nesral%'; SELECT COUNT(*) FROM MediaStreams2 WHERE Path LIKE '%/opt/media/nesral%'; " If all three return 0, your Emby database is clean. Step 5 - Restart Emby Everything is fixed...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now