Cheesegeezer 3096 Posted October 28, 2022 Posted October 28, 2022 (edited) Cheesey Productions brings you Intros Backup for Emby Bringing you a way to Backup/Restore all your IntroSkip and CreditSkip Markers This plugin saves you time after a new install or after refreshing metadata by not having to conduct the process of conducting the intro fingerprint and detection tasks from the core side. Available from the plugin catalogue A huge shout out to @rbjtech and @elpooletfor all their help with this. PLEASE NOTE THAT TINY MEDIA MANAGER CAUSES ISSUES WITH MULTI EPISODE nfo files. I’m currently working to get this fixed but stick to JSON backup option only to ensure your intros are backed up. This plugin works very simply. For BACKUP - The user can Write these markers to JSON files stored in a user specified folder location and/or write directly to the NFO file stored in the Episodes media folder For RESTORE - The user can select to Write information back to episode chapter information markers using either JSON files OR the NFO file setup. BACKUP - takes yout existing markers from the episodes chapter table and will overwrite all previously backed up information. RESTORE will overwrite all currently stored markers and replace them with what is stored in the backup Shortcut in the Server Side Menu Setup your own timing for when to run the backup utility from the Scheduled Task Menu Backup Log Example with Debug enabled Restore Log Example with Debug Enabled Enjoy!! Always a pleasure Edited November 5, 2022 by Cheesegeezer 5
Cheesegeezer 3096 Posted October 28, 2022 Author Posted October 28, 2022 V1.0.0.2 uploaded to the Catalogue. This fixes issue where user cannot search or select the backup folder location. Thanks for the feedback @sydlexius and @elpoolet for the bug.
Cheesegeezer 3096 Posted October 28, 2022 Author Posted October 28, 2022 Ok peeps an interesting bug has arisen. those that use emby for metadata can you pay specific attention to multi episodes. For example Blogright S01-E01E02 and see if the information is written correctly for those using external media nfo managers can you also check the nfo files to ensure accuracy for multi episodes please. this is something I didn’t take into consideration and want to cater for. thanks as always
Cheesegeezer 3096 Posted October 29, 2022 Author Posted October 29, 2022 V1.0.0.3 is now available from the catalogue Cater for MultiEpisode items - E.G. House S01E01E02 Fixed errors on NFO Restore. Thanks peeps @sydlexius let me know if this fixes your issues. Cheers fella
elpoolet 21 Posted October 29, 2022 Posted October 29, 2022 Hi @Cheesegeezer I launched a backup on my "prod" environment. Less than 4 seconds for 8500 episodes ! For multi episodes files here's the log of the backup. I didn't try to restore at the moment. 2022-10-29 11:46:04.857 Info Intros Backup-Backup: Checking for Intros/Credits for TVDBId = 295696 - IMDBId = tt0234794 - TMDBId = 2022-10-29 11:46:04.857 Info Intros Backup-Backup: Intros/Credits Info for Stargate SG-1 - S1:E1 2022-10-29 11:46:04.857 Info Intros Backup-Backup: Backing up JSON Intros for Stargate SG-1 - S1:E1 2022-10-29 11:46:04.857 Info Intros Backup-Backup: JSON Backup File Created: E:\emby-data\intro-backup\Stargate SG1 - S1E1-E2.json And the content {"TvdbId":"295696","ImdbId":"tt0234794","TmdbId":null,"SeriesName":"Stargate SG1","SeasonNumber":1,"EpisodeNumber":1,"EpisodeNumberEnd":2,"IntroStart":3441542288,"IntroEnd":4026119402,"CreditStart":0} 1
Cheesegeezer 3096 Posted October 29, 2022 Author Posted October 29, 2022 2 minutes ago, elpoolet said: Hi @Cheesegeezer I launched a backup on my "prod" environment. Less than 4 seconds for 8500 episodes j For multi episodes files here's the log of the backup. I didn't try to restore at the moment. 2022-10-29 11:46:04.857 Info Intros Backup-Backup: Checking for Intros/Credits for TVDBId = 295696 - IMDBId = tt0234794 - TMDBId = 2022-10-29 11:46:04.857 Info Intros Backup-Backup: Intros/Credits Info for Stargate SG-1 - S1:E1 2022-10-29 11:46:04.857 Info Intros Backup-Backup: Backing up JSON Intros for Stargate SG-1 - S1:E1 2022-10-29 11:46:04.857 Info Intros Backup-Backup: JSON Backup File Created: E:\emby-data\intro-backup\Stargate SG1 - S1E1-E2.json And the content {"TvdbId":"295696","ImdbId":"tt0234794","TmdbId":null,"SeriesName":"Stargate SG1","SeasonNumber":1,"EpisodeNumber":1,"EpisodeNumberEnd":2,"IntroStart":3441542288,"IntroEnd":4026119402,"CreditStart":0} Everything looks good actually. The json file method is very quick, the nfo writing method takes quite a bit longer. But thanks for the feed back buddy 1
olli1806 8 Posted October 31, 2022 Posted October 31, 2022 (edited) hallo Synology DS1821+/ DSM 7.1.1-42962 Update 2 ich bekomme diese Fehlermeldung " Data at the root level is invalid. Line 235, position 18. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.Load(String filename) at Intros.Backup.ScheduledTasks.IntrosBackupScheduledTask.WriteInfoToNFO(BaseItem item, String seriesName, Nullable`1 seasonNumber, Nullable`1 episodeNumber, Nullable`1 episodeNumEnd, String tvdbId, String imdbId, String tmdbId, Int64 introStartTime, Int64 introEndTime, Int64 creditStartTime) at Intros.Backup.ScheduledTasks.IntrosBackupScheduledTask.Execute(CancellationToken cancellationToken, IProgress`1 progress) at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options) " lg olli Edited October 31, 2022 by olli1806
Cheesegeezer 3096 Posted October 31, 2022 Author Posted October 31, 2022 2 minutes ago, olli1806 said: Hello I get this error message " Data at the root level is invalid. Line 235, position 18. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.Load(String filename) at Intros.Backup.ScheduledTasks.IntrosBackupScheduledTask.WriteInfoToNFO(BaseItem item, String seriesName, Nullable`1 seasonNumber, Nullable`1 episodeNumber, Nullable`1 episodeNumEnd, String tvdbId, String imdbId, String tmdbId, Int64 introStartTime, Int64 introEndTime, Int64 creditStartTime) at Intros.Backup.ScheduledTasks.IntrosBackupScheduledTask.Execute(CancellationToken cancellationToken, IProgress`1 progress) at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options) " lg Olli Thanks. Can you also supply the nfo file please. Are you using TinyMediaManager? Please turn on debug logging and send me the log. Thanks
olli1806 8 Posted October 31, 2022 Posted October 31, 2022 hi 1 tinyMediaManager ja 2 debug logging ?????? 3 welche nfo. möchten sie ? LG Olli
Cheesegeezer 3096 Posted October 31, 2022 Author Posted October 31, 2022 1 minute ago, olli1806 said: hi 1 tinyMediaManager ja 2 debug logging ?????? 3 which info. Do you want to ? LG Olli Thanks, TMM is what is causing the issue. You can still just use JSON back but turn off NFO writing. @sydlexius has been working with me, and i will hopefully factor in a fix for TMM users.
Cheesegeezer 3096 Posted November 5, 2022 Author Posted November 5, 2022 PLEASE NOTE THAT TINY MEDIA MANAGER CAUSES ISSUES WITH MULTI EPISODE nfo files. I’m currently working to get this fixed but stick to JSON backup option only to ensure your intros are backed up. stay tuned
pünktchen 1339 Posted November 5, 2022 Posted November 5, 2022 26 minutes ago, Cheesegeezer said: PLEASE NOTE THAT TINY MEDIA MANAGER CAUSES ISSUES WITH MULTI EPISODE nfo files. Can you elaborate on this please!?
Cheesegeezer 3096 Posted November 5, 2022 Author Posted November 5, 2022 1 minute ago, pünktchen said: Can you elaborate on this please!? No probs fella. the nfo files i have received are as follows… these aren’t official formats for anything but they are formatted like an xml. And there is no root node encapsulating the rest of the info, so all the <episodedetails> elements are classed as root which throws lots of errors when loading the nfo. Because xml should only ever have 1 root node. So i need to either add a root node, but not sure if that would be backward compatible with TMM. I’ve exhausted xml side now so onto other ways now.
pünktchen 1339 Posted November 5, 2022 Posted November 5, 2022 Ah, i see. But that's not a fault of TMM. It's a fault of the Kodi standard for nfo files.
Cheesegeezer 3096 Posted November 5, 2022 Author Posted November 5, 2022 (edited) 6 minutes ago, pünktchen said: Ah, i see. But that's not a fault of TMM. It's a fault of the Kodi standard for nfo files. I beg to differ. Because you can select emby as your media manager in TMM. Emby respects multi episode and all emby nfo files are formatted to xml specs. if i choose Kodi as my media manager( especially as a paid application) then i expect it to workwith kodi ecosystem. I click emby then the same. realistically.. this into backup plugin is for emby so I’m using that ecosystem and say say tuff… but i wanna help out the community so they can “have their media… their way” Edited November 5, 2022 by Cheesegeezer
pünktchen 1339 Posted November 5, 2022 Posted November 5, 2022 18 minutes ago, Cheesegeezer said: Emby respects multi episode and all emby nfo files are formatted to xml specs. But those nfo are not Kodi conform. Either Emby follows the Kodi standard or they should never have changed to nfo instead of it's own xml. TMM is not the only metadata manager out there to write nfo files, but Emby is the only one that does it wrong for multi episode files.
Luke 38954 Posted November 5, 2022 Posted November 5, 2022 30 minutes ago, pünktchen said: But those nfo are not Kodi conform. Either Emby follows the Kodi standard or they should never have changed to nfo instead of it's own xml. TMM is not the only metadata manager out there to write nfo files, but Emby is the only one that does it wrong for multi episode files. It's just something that hasn't been done yet.
pünktchen 1339 Posted November 6, 2022 Posted November 6, 2022 2 hours ago, Luke said: It's just something that hasn't been done yet. Although you know about it for nearly 4 years! https://emby.media/community/index.php?/topic/69879-reading-and-writing-of-nfo-for-multi-part-episodes-is-wrong/
Cheesegeezer 3096 Posted November 6, 2022 Author Posted November 6, 2022 8 hours ago, pünktchen said: But those nfo are not Kodi conform. Either Emby follows the Kodi standard or they should never have changed to nfo instead of it's own xml. TMM is not the only metadata manager out there to write nfo files, but Emby is the only one that does it wrong for multi episode files. can you point to the standard from kodi please it may help me with my issues. I'm really quite shocked about this multi episode hiccup.... because XBMC was heavily XML driven and conformed to the xml validation standards.
Cheesegeezer 3096 Posted November 6, 2022 Author Posted November 6, 2022 8 hours ago, pünktchen said: But those nfo are not Kodi conform. Either Emby follows the Kodi standard or they should never have changed to nfo instead of it's own xml. TMM is not the only metadata manager out there to write nfo files, but Emby is the only one that does it wrong for multi episode files. So i found the info i needed and it must be a bug on Kodi's part from their documentation!! XML can only have ONE root element. Really the <episodedetails> elements should be wrapped in a <multiepisodes> root element. Taken from NFO files/Templates - Official Kodi Wiki <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <episodedetails> <!--First Episode --> <title>Grieve No More</title> <showtitle>Carnival Row</showtitle> <ratings> <rating name="imdb" max="10" default="true"> <value>7.800000</value> <votes>1746</votes> </rating> <rating name="tmdb" max="10"> <value>7.700000</value> <votes>15</votes> </rating> </ratings> <userrating>0</userrating> <top250>0</top250> <season>1</season> <episode>5</episode> <displayseason>-1</displayseason> <displayepisode>-1</displayepisode> <outline></outline> <plot>Philo consults a Haruspex in an effort to find clues about the killer. Vignette grows closer with her newfound family. Upon Jonah’s return home, his parents cast a more watchful eye over him as a new player makes a splash in Parliament. Imogen brings Agreus into her circle.</plot> <tagline></tagline> <runtime>0</runtime> <thumb spoof="" cache="" aspect="thumb" preview="https://image.tmdb.org/t/p/w780/mcVI7yQjXmreUQcyxRJ3dFTFszI.jpg">https://image.tmdb.org/t/p/original/mcVI7yQjXmreUQcyxRJ3dFTFszI.jpg</thumb> <thumb spoof="" cache="" aspect="thumb" preview="https://image.tmdb.org/t/p/w780/6Mf23JoPQsj2deyvrKMCZEvgyB4.jpg">https://image.tmdb.org/t/p/original/6Mf23JoPQsj2deyvrKMCZEvgyB4.jpg</thumb> <mpaa>Australia:TV-MA</mpaa> <playcount>0</playcount> <lastplayed></lastplayed> <id>1906721</id> <uniqueid type="imdb">tt6599052</uniqueid> <uniqueid type="tmdb" default="true">1906721</uniqueid> <uniqueid type="tvdb">7221242</uniqueid> <genre>Sci-Fi & Fantasy</genre> <credits>Ian Deitchman</credits> <credits>Kristin Rusk Robinson</credits> <director>Andy Goddard</director> <premiered>2019-08-29</premiered> <year>2019</year> <status></status> <code></code> <aired>2019-08-29</aired> <studio>Amazon</studio> <trailer></trailer> <actor> <name>Orlando Bloom</name> <role>Rycroft "Philo" Philostrate</role> <order>0</order> <thumb>https://image.tmdb.org/t/p/original/pulwUR0lZ8IWwXUCRXCnyWfYvNL.jpg</thumb> </actor> <actor> <name>Cara Delevingne</name> <role>Vignette Stonemoss</role> <order>1</order> <thumb>https://image.tmdb.org/t/p/original/izZ8IbsIjNpjZ5S0HIYreVwVRzn.jpg</thumb> </actor> <resume> <position>0.000000</position> <total>0.000000</total> </resume> <dateadded>2021-12-30 15:41:30</dateadded> </episodedetails> <episodedetails> <!--Second Episode --> <title>Unaccompanied Fae</title> <showtitle>Carnival Row</showtitle> <ratings> <rating name="imdb" max="10" default="true"> <value>7.900000</value> <votes>1627</votes> </rating> <rating name="tmdb" max="10"> <value>7.500000</value> <votes>15</votes> </rating> </ratings> <userrating>0</userrating> <top250>0</top250> <season>1</season> <episode>6</episode> <displayseason>-1</displayseason> <displayepisode>-1</displayepisode> <outline></outline> <plot>The pieces of the puzzle start to come together for Philo. Vignette finds home in a place she never expected. Jonah sneaks off to see someone he shouldn’t. Imogen and Agreus step out together in public.</plot> <tagline></tagline> <runtime>0</runtime> <thumb spoof="" cache="" aspect="thumb" preview="https://image.tmdb.org/t/p/w780/y6A3ZXbSBoc3HwBj1J3KWWvrrzW.jpg">https://image.tmdb.org/t/p/original/y6A3ZXbSBoc3HwBj1J3KWWvrrzW.jpg</thumb> <thumb spoof="" cache="" aspect="thumb" preview="https://image.tmdb.org/t/p/w780/7gZBOfmfAxkUpd4jL9WS6p78EoH.jpg">https://image.tmdb.org/t/p/original/7gZBOfmfAxkUpd4jL9WS6p78EoH.jpg</thumb> <mpaa>Australia:TV-MA</mpaa> <playcount>0</playcount> <lastplayed></lastplayed> <id>1906722</id> <uniqueid type="imdb">tt6599058</uniqueid> <uniqueid type="tmdb" default="true">1906722</uniqueid> <uniqueid type="tvdb">7221243</uniqueid> <genre>Sci-Fi & Fantasy</genre> <credits>Stephanie K. Smith</credits> <director>Andy Goddard</director> <premiered>2019-08-29</premiered> <year>2019</year> <status></status> <code></code> <aired>2019-08-29</aired> <studio>Amazon</studio> <trailer></trailer> <actor> <name>Leanne Best</name> <role>Madame Moira</role> <order>4</order> <thumb>https://image.tmdb.org/t/p/original/3GJSWDGuINZjQEgz06wlBELoJCK.jpg</thumb> </actor> <actor> <name>Issy Stewart</name> <role>Louisa Pembroke</role> <order>6</order> <thumb>https://image.tmdb.org/t/p/original/2Ektp4uatPA6gZj32xjjPWKZBKm.jpg</thumb> </actor> <resume> <position>0.000000</position> <total>0.000000</total> </resume> <dateadded>2021-12-30 15:41:30</dateadded> </episodedetails> <episodedetails> <!--Third Episode --> <title>The World to Come</title> <showtitle>Carnival Row</showtitle> <ratings> <rating name="imdb" max="10" default="true"> <value>8.000000</value> <votes>1659</votes> </rating> <rating name="tmdb" max="10"> <value>7.700000</value> <votes>15</votes> </rating> </ratings> <userrating>0</userrating> <top250>0</top250> <season>1</season> <episode>7</episode> <displayseason>-1</displayseason> <displayepisode>-1</displayepisode> <outline></outline> <plot>Because he withheld evidence from his fellow detectives, Philo is accused of being the man behind the string of murders and is thrown in jail. There, he finds some unexpected help from Vignette. Elsewhere, Ezra takes exception to Imogen’s relationship with Agreus. Sophie offers Jonah a deal.</plot> <tagline></tagline> <runtime>0</runtime> <thumb spoof="" cache="" aspect="thumb" preview="https://image.tmdb.org/t/p/w780/ov05qVU8JVZ66BQK457MLMg7Wfu.jpg">https://image.tmdb.org/t/p/original/ov05qVU8JVZ66BQK457MLMg7Wfu.jpg</thumb> <mpaa>Australia:TV-MA</mpaa> <playcount>0</playcount> <lastplayed></lastplayed> <id>1906725</id> <uniqueid type="imdb">tt7435152</uniqueid> <uniqueid type="tmdb" default="true">1906725</uniqueid> <uniqueid type="tvdb">7221244</uniqueid> <genre>Sci-Fi & Fantasy</genre> <credits>Peter Cameron</credits> <credits>René Echevarria</credits> <director>Jon Amiel</director> <premiered>2019-08-29</premiered> <year>2019</year> <status></status> <code></code> <aired>2019-08-29</aired> <studio>Amazon</studio> <trailer></trailer> <actor> <name>Jonathan Daniel Brown</name> <role>Ticket Clerk</role> <order>48</order> <thumb>https://image.tmdb.org/t/p/original/xDsPJNDnrn3N0jelVrxdOchzhoo.jpg</thumb> </actor> <actor> <name>John Poston</name> <role>Cell Block Guard</role> <order>49</order> <thumb></thumb> </actor> <resume> <position>0.000000</position> <total>0.000000</total> </resume> <dateadded>2021-12-30 15:41:30</dateadded> </episodedetails>
Cheesegeezer 3096 Posted November 6, 2022 Author Posted November 6, 2022 Anyways I'm making progress here. I can now read the malformed xml and handle it and the task completes without errors. So just need to write the markers back now 1 1
pünktchen 1339 Posted November 6, 2022 Posted November 6, 2022 6 hours ago, Cheesegeezer said: it must be a bug on Kodi's part from their documentation!! Apparently not: https://github.com/xbmc/xbmc/blob/ca66635cc83aef6ff61757c46890dbe7f2d26276/xbmc/NfoFile.cpp#L56-L77
Cheesegeezer 3096 Posted November 6, 2022 Author Posted November 6, 2022 17 minutes ago, pünktchen said: Apparently not: https://github.com/xbmc/xbmc/blob/ca66635cc83aef6ff61757c46890dbe7f2d26276/xbmc/NfoFile.cpp#L56-L77 Well it’s a malformed xml… therefore they should not add the xml header and call it something else
Cheesegeezer 3096 Posted November 6, 2022 Author Posted November 6, 2022 (edited) I dunno much about c++ but in that class they are looking at documents & strings and not xml or nodes or elements in that code. So it’s gonna work for them. Which is the way i have to tackle this with streamreaders and writers. Edited November 6, 2022 by Cheesegeezer
sydlexius 259 Posted November 6, 2022 Posted November 6, 2022 7 hours ago, Cheesegeezer said: I dunno much about c++ but in that class they are looking at documents & strings and not xml or nodes or elements in that code. So it’s gonna work for them. Which is the way i have to tackle this with streamreaders and writers. Well, I don't see this "standard" changing anytime soon. Perhaps the Emby devs will see fit to make it "bug compatible" with XBMC/Kodi.
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