jsaddiction / TrailerTech

Download Trailers for you movies
MIT License
13 stars 4 forks source link

Download trailers for future movies (even if movie directory is empty) #57

Open Mavyre opened 1 year ago

jsaddiction commented 1 year ago

I like the idea you are going with here and had the same thought during the initial build. One problem I see with this is that many people do not stick with the standard naming conventions throughout their libraries which may result in "left overs". For instance, If a user were to populate a trailer prior to the movie, the file name of the trailer would be forced into /Title (1234).ext. Later the movie would download under something slightly different /Title - 1234.ext and this script would be triggered to download a new trailer under the Radarr configured naming convention, thusly leaving the originally downloaded trailer in place and adding the new one.

This feature could be implemented in a cleaner way utilizing Radarr's api similar to the "extended" versions of the ARR suite. The idea would be to collect the naming convention config from Radarr's api and utilize that for constructing the trailers filename.

Another Idea, utilize either a small sqlite db or json file to store details about each trailer this script downloads and offer the ability to "upgrade" qualities/language if found/configured. If upgrades are not configured, the only parse directories where trailers have not been downloaded rather than run ffmpeg on every single movie file.

I have not abandoned the project but I do think a major overhaul is needed and currently my attention is in other media formats "lidarr-ext" for the moment.

Mavyre commented 1 year ago

I had this in mind while writting it, and thought that this would be most likely an issue. Two questions/remarks here:

Thanks for taking time to review it!

jsaddiction commented 1 year ago

To your first point, I think that might actually work out pretty good but the script may have to be called on the onRename hook as well. Another thought / question I have: Does kodi even parse the directories which do not contain a movie? I think kodi requires a .nfo and some media to scan into it's library. If all the metadata is properly placed into the movie's eventual directory including a trailer but no movie, does Kodi even add it to the library? Does kodi assume that the trailer is the movie regardless of the -trailer in the file name? I am not 100% on this but kodi may not add a movie that doesn't exsist. All the other stuff 'images, nfo, trailer' are supporting metadata that should be in addition to the movie file.

In Kodi and other media player applications, the filename of the trailer must match the movie's filename with the -trailer inserted at the end. Your second point can't be the solution and maintain a reliable representation in the various applications the end user might employ.

I am not trying to be a pain, just not clear on what problem you're trying to solve. I think there are other kodi add-ons which allow playback of internet sourced trailers for movies not in your library yet. I used to have one that was like a pre-roll that displayed a more cinematic experience where it would introduce new movies before watching the one I intended to watch.

Mavyre commented 1 year ago

I think you're talking about CinemaVision for KODI (now called PreShow Experience, by the way!). And it's exactly because of this addon that I need filenames that can change (CV/PSE both need the audio codec in the filname for Atmos/DTS:X bumpers to work). So, the best would be the first point, which actually would rename the trailers according to the naming scheme of newly imported/upgraded movie files.

To explain more my main problem: having that "upcoming" trailers allows me, with the help of a script, to actually display only trailers that will be added on my server. Those trailers would be displayed both on Kodi PreShow Experience, and on Live TV. Also, PSE have some issuues fetching trailers. I'm currently making a small script which picks the trailers depending on Radarr availability and puts them (hardlinks) in an Upcoming trailers folder.

Edit: I had the idea of second point because Jellyfin also works if the file is only named trailer.mp4!

jsaddiction commented 1 year ago

Honestly, to get the functionality that I think you are after we need to implement the first suggestion mentioned where the filename is picked from Radarr's api. Have a look at https://github.com/RandomNinjaAtk/docker-radarr-extended. I have had some success with those scripts. It might at least give you some ideas. I do plan on an overhaul of this repo but it will come in stages. I will keep your suggestions in mind specifically with PSE. Maybe there should be a directory that holds your upcoming trailers seperate from any movie directory where you could point PSE for reference. This would also benefit from an interface with the Radarr API. It could pull titles from the recommendations, movies not yet downloaded, etc.

For now though, I will hold off on this PR with a shift of interest to expanding functionality and be more integrated with Radarr.