rbjtech 4283 Posted April 19, 2021 Share Posted April 19, 2021 (edited) So up until this point I've been manually hacking together 'Crossover' episodes using 'Specials' - a very manually intensive and frankly laborious task. I soon realised that this is not only wasting my time, but nothing was consistent and I would lose the lot during a database rebuild or metadata refresh etc. So I thought i'd put together a script to automate this to make it - Repeatable Consistent Accurate What does it do ? Creates a .strm (link) file in the 'Specials/Season 0' folder - linking to the real media file. Copies the associated jpg file Creates a relevant nfo file - used for naming and placing the 'Special'. It does this for each member of the crossover and for all combinations. So in a simple 2 way crossover, it will create 1 'crossover' per show (2 crossover links created). You can have a maximum of 5 crossover events - so in this extreme example, each show would have an extra 4 'Specials/Crossovers' per normal episode (20 crossover links created). The reason for doing this is so it doesn't matter which show you are watching, you will always see ALL members of the crossover. So taking an example - Arrowverse Invasion ! (a 3 way crossover) The first part of the crossover is 'the Flash' so that appears as it would do normally ... (episode 8 ) .. .. the script has inserted the two 'crossover' episodes after ep8 - they are named accordingly (Arrow, then DC Legends) and the plot also details all the members of the crossover in order - with the current 'real' member in square brackets. .. Arrow is next in the crossover, so in that show, it is listing the crossovers as 'the Flash' (before) and DC Legends (after), with the Arrow episode being ep8. Finally, in the 3rd show - DC legends, it has put the two 'crossover' episodes before the DC legends Ep7. So it doesn't matter what show you are viewing it from - you always get the correct crossover sequence. Pre-requisites - The metadata nfo/artwork needs to be stored alongside the media file - this will not work if this option is not ticked (ie your metadata/artwork is held within the emby subdirectories instead). What is the script ? Unfortunately it's just a Windows based batch script that does the work (yuk, yes I know..) but it's been developed over time when I was just mucking about getting the concept correct and it works just fine, so I have no real inclination to convert it to Powershell or Python etc as speed is not really an issue here. Run it from a Command prompt - you do not need any elevated permissions but will need permissions to write to the media directories. What is the input file ? It's just a semi-colon delimited text file, listing all the crossover data. My exact file is attached, but you'll obviously need to generate your own in the format :- <special number>;<crossover name>;<show1 path to file>;<show1 season>;<show1 episode>;<show2 path to file.... blah blah <special number> is just a unique number sequence for each franchise, 10 will start the episode numbering at 101 - meaning it should not interfere with any existing specials. List of the episodes should match the crossover sequence - ie unc file 1 will show first, unc file 2 will show second etc.. Media File location ? Grab the media file location from the 'Media Info' section in a web browser - just copy and paste it into the input file. Testing I have only tested with UNC file paths (shares), but there is no reason it should not work with drive letters and folders. For your system, I suggest just creating a single crossover (or modify my file) and check to see what is has done before adding others. Nothing on the script deletes or modifies existing files in any way - it only creates new or copies existing files. Execution speed depends on your system, but for all the crossovers I have listed, it takes about 30 seconds to generate them all. Improvements Many things haha - I need to sort out creating the nfo files in a more elegant way .. I would also like to have each show listed as a new line in the 'plot' text, but could not get this to work. Down the line, I'd also like to get the input list created from the media ID's via the Emby API rather than UNC links, but one step at a time. Also - Read the Season and Episode from the UNC filename rather than add in the input file - should be easy enough to do, I just haven't got around to it yet .. Suggestions welcome Other things to note .. The crossover episodes are 'backdated' when they are created (year 2000) - they will therefore not screw up any 'new items or next up' lists. When created, you'll have to find them in the shows in the relevant season - or a quick check in Season 0 will list them all. 'Next Up Special Playing in sequence' - will only work in the Beta release - the current 'Release' does NOT honour the special sequence playback numbering. As soon as the long overdue Beta is promoted to Release, this will be fixed. (or run the beta).. edit 21/05 - 'Next Up' Special Playing sequence now works with the current Release - 4.6 Edited May 21, 2021 by rbjtech Expand details on metadata/artwork location 5 Link to comment Share on other sites More sharing options...
rbjtech 4283 Posted April 19, 2021 Author Share Posted April 19, 2021 (edited) emby_crossover.batcrossover.txt These is the script and (my) input file. Rename the emby_crossover.bat.txt file as a .bat file as Windows will likely reject the .bat file direct download. emby_crossover.bat.txt Edited April 19, 2021 by rbjtech 1 Link to comment Share on other sites More sharing options...
NitroKyx 0 Posted April 27, 2021 Share Posted April 27, 2021 This is pretty cool. Will definitely play around with this. Link to comment Share on other sites More sharing options...
RaptorCentauri 49 Posted April 27, 2021 Share Posted April 27, 2021 What do you mean by On 4/19/2021 at 3:49 PM, rbjtech said: The metadata needs to be stored with the media - this will not work if the metadata is stored locally. if the metadata is with the media, doesn't that mean its stored locally? 1 Link to comment Share on other sites More sharing options...
Luke 37093 Posted April 28, 2021 Share Posted April 28, 2021 4 hours ago, RaptorCentauri said: What do you mean by if the metadata is with the media, doesn't that mean its stored locally? Yes that's what he means. Link to comment Share on other sites More sharing options...
rbjtech 4283 Posted April 28, 2021 Author Share Posted April 28, 2021 Hi @RaptorCentauri In the library settings - you can opt to save the metadata/artwork/nfo in the folders alongside the media file itself. It doesn't matter where the media is - be it on a NAS (UNC path) or 'local' disk. (drive letter). My script only works if this option is selected, because otherwise it doesn't know where the metadata/artwork is held as it gets it's path from the media file location. I'll reword this to make it clearer - thanks for pointing this out. Link to comment Share on other sites More sharing options...
Diedrich 355 Posted May 26, 2021 Share Posted May 26, 2021 @rbjtech Sorry for being dense, but where do I put the bat/text file? In the root of my TV library, the root of the series folder, or the series season 0 folder? Link to comment Share on other sites More sharing options...
rbjtech 4283 Posted May 26, 2021 Author Share Posted May 26, 2021 Hi - It doesn't matter where you run the bat/txt file from as long as it has permissions to modify the file system or shares listed in the txt file. Maybe create a folder on your c drive and run it from there. Link to comment Share on other sites More sharing options...
Diedrich 355 Posted May 26, 2021 Share Posted May 26, 2021 (edited) 53 minutes ago, rbjtech said: Hi - It doesn't matter where you run the bat/txt file from as long as it has permissions to modify the file system or shares listed in the txt file. Maybe create a folder on your c drive and run it from there. Thanks. My issue was that I am using a Windows computer to run the bat file (for ease of use) but my Emby server is on a Ubuntu host. So I did what you suggested above and used the unc location and then just went back into the strm files and adjusted the file location. Ok, so some questions... It created the appropriate links in the Stargate SG-1 and Stargate Atlantis season 0 folders but I thought it was also going to make links in the appropriate series seasons, e.g. Stargate SG-1: Season 8 Stargate SG-1 s08e01 Stargate SG-1 s08e02 and then after that would be the strm file for Stargate Atlantis s01e01.strm and then in the Atlantis series it would create a strm file to Stargate SG-1 Stargate Atlantis: Season 1 Stargate SG-1 s08e01.strm Stargate SG-1 s08e02.strm Stargate Atlantis s01e01 Edited May 26, 2021 by Diedrich Link to comment Share on other sites More sharing options...
rbjtech 4283 Posted May 26, 2021 Author Share Posted May 26, 2021 1 hour ago, Diedrich said: Ok, so some questions... It created the appropriate links in the Stargate SG-1 and Stargate Atlantis season 0 folders but I thought it was also going to make links in the appropriate series seasons, e.g. It doesn't need to because it gets the link location from the metadata in the season 0 nfo file in the 'Specials' section. Emby itself then put's in the correct season and episode location for you. So first question - Do you have the NFO reader turned on for this library ? If you look in the Stargate SG1 season 0 folder - you should have a .strm file plus a .nfo file as well ? The .nfo should have something like this is it - this tells emby where to put that special. In the example below it will appear in season 1 after episode 9. <episode>101</episode> <season>0</season> <displayepisode>9</displayepisode> <displayseason>1</displayseason> Link to comment Share on other sites More sharing options...
Locutus64 119 Posted September 21, 2023 Share Posted September 21, 2023 I was hoping to have crossovers independent of the regular episodes so as in you example 8 would be skipped when looking at the season and just in a special folder for the episodes involved in the crossover, but this looks like it would work very nicely cause if I don't want to watch the crossover I can just skip to the next episode after the crossover. I'll have a go at this. Thanks for putting in the time to create this, very much appreciated. Link to comment Share on other sites More sharing options...
rbjtech 4283 Posted September 21, 2023 Author Share Posted September 21, 2023 (edited) 9 minutes ago, Locutus64 said: I was hoping to have crossovers independent of the regular episodes so as in you example 8 would be skipped when looking at the season and just in a special folder for the episodes involved in the crossover, but this looks like it would work very nicely cause if I don't want to watch the crossover I can just skip to the next episode after the crossover. I'll have a go at this. Thanks for putting in the time to create this, very much appreciated. It gets complicated really quickly - especially for the CW crossovers with 5 shows having crossovers ! The idea behind it was to include the crossovers from the other shows seemlessly - because they will then get marked as 'watched', if you then watch the other show(s), then those episodes will get skipped, as you have already watched them. ie If you watch 'Invasion!' while watching the Flash, you won't view it again if then watching 'Arrow' for example. If I were to do it again, I'd either use the Emby API or via an Emby Plugin - as currently it uses NFO files to update the placement of the crossover within the season - far from ideal ! Have fun. Edited September 21, 2023 by rbjtech 1 Link to comment Share on other sites More sharing options...
Locutus64 119 Posted September 21, 2023 Share Posted September 21, 2023 I knew that this was going to be a project and a half when I decided to do this. Think I'm going to put in a feature request for edible playlist. So few crossovers they won't look out of place in a drop down list of playlist on the left side of the Home screen. Thanks again. Link to comment Share on other sites More sharing options...
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