Jellyfin Forum
Q: How to export/generate text file with list of unplayed movies/tvshows - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Q: How to export/generate text file with list of unplayed movies/tvshows (/t-q-how-to-export-generate-text-file-with-list-of-unplayed-movies-tvshows)



Q: How to export/generate text file with list of unplayed movies/tvshows - bernard - 2024-03-28

When I travel I carry a SSD with media I have not yet played with me to be entertained during transportation. The media files are synced using rsync from my NAS. For rsync I need a list of unplayed media filenames. In earlier days I generated this list from the Kodi library using SQL. Nowadays I am using Jellyfin for Kodi, i.e. I could still use the Kodi library DB to extract that list. However, this seems to be a somewhat indirect approach, as this data gets synced from Jellyfin anyways.

So I would rather like to extract the list of unplayed movies/tvshows from Jellyfin using the UI, or if that is not possible, using SQL from the Jellyfin library DB.

Clearly I can generate a list of unplayed movie titles in the UI, but I have not found a way to export the list of these movie titles to a text file. So my first questions are whether this can be done and how. Also: The Titles as shown in the UI do not necessarily match the filenames on disk, so this approach is probably doomed anyway.

If it is not possible to extract a list of unplayed movie filenames from the UI, where would I find some example SQL queries (or possible queries that would already do exactly what I have described)? 
Where may I find documentation about the table attributes of the Jellyfin library DB?


RE: Q: How to export/generate text file with list of unplayed movies/tvshows - Efficient_Good_5784 - 2024-03-28

One workaround that you could do is use nfo files if you have those enabled.

Each nfo file stores the watched status of their respective video for a user of your choice.

You could create a bash script that gets all the nfo files in a directory, uses grep on them to look for the unwatched status, then prints out a list of the nfo files it matched as unwatched.

Then you would have to add some logic to tell the script to get the video file of the nfo and store that in a new list. This is easy with sed if all your video files are in one format (using sed to replace all ".nfo" extensions to ".mkv" as an example). However, if your videos are a mix of video extension types, you'll have to figure out how to get the final list of the video files correctly.

I don't remember if the nfo files have the exact video file name however, but if it does, it would be helpful here.


RE: Q: How to export/generate text file with list of unplayed movies/tvshows - TheDreadPirate - 2024-03-28

Check out the "Reports" plugin. I believe it also tracks watch status and allows you to generate CSV reports.