Jump to content

Intros Backup Support Thread


Cheesegeezer

Recommended Posts

Cheesegeezer

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.

image.png.523da0317e7b5bc3f580a44190758151.png

 

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

image.thumb.png.1099e6f2d19351e43b855480e9d83052.png

For RESTORE -  The user can select to Write information back to episode chapter information markers using either JSON files OR the NFO file setup.

image.thumb.png.9ded38daded1053fb5bc4ae078168466.png

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

image.png.18ea536e2e505d21635a1b1088dde51a.png

Setup your own timing for when to run the backup utility from the Scheduled Task Menu

image.png.fa4d3758b92d7b984a4d960d23f65c31.png

Backup Log Example with Debug enabled

image.thumb.png.2fd6c355e31e7d70bac71f322c384f13.png

Restore Log Example with Debug Enabled

image.thumb.png.017c84989226e6b78c1690f9f649a2bb.png

Enjoy!! Always a pleasure

Edited by Cheesegeezer
  • Like 4
Link to comment
Share on other sites

Cheesegeezer

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.

Link to comment
Share on other sites

Cheesegeezer

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

 

Link to comment
Share on other sites

Cheesegeezer

V1.0.0.3 is now available from the catalogue

  1. Cater for MultiEpisode items - E.G. House S01E01E02
  2. Fixed errors on NFO Restore.

Thanks peeps

@sydlexius let me know if this fixes your issues.

Cheers fella

 

Link to comment
Share on other sites

elpoolet

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}

 

  • Thanks 1
Link to comment
Share on other sites

Cheesegeezer
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

  • Like 1
Link to comment
Share on other sites

olli1806

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 by olli1806
Link to comment
Share on other sites

Cheesegeezer
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

Link to comment
Share on other sites

Cheesegeezer
1 minute ago, olli1806 said:

hi

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.

Link to comment
Share on other sites

Cheesegeezer

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 😉 

Link to comment
Share on other sites

pünktchen
26 minutes ago, Cheesegeezer said:

PLEASE NOTE THAT TINY MEDIA MANAGER CAUSES ISSUES WITH MULTI EPISODE nfo files.

Can you elaborate on this please!?

Link to comment
Share on other sites

Cheesegeezer
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.

 

Link to comment
Share on other sites

Cheesegeezer
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 by Cheesegeezer
Link to comment
Share on other sites

pünktchen
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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Cheesegeezer
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.  

Link to comment
Share on other sites

Cheesegeezer
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

image.thumb.png.3f344f29847fb53e4e76af2ad4b5770d.png

<?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 &amp; 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 &quot;Philo&quot; 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 &amp; 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 &amp; 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>

 

Link to comment
Share on other sites

Cheesegeezer

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 🤔

image.thumb.png.ccbc5e67996204cd8bfca53dac3b5c0c.png

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Cheesegeezer

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 by Cheesegeezer
Link to comment
Share on other sites

sydlexius
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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...