Kodi Community Forum
TheTVDB.com Scraper absolute_number for Anime? - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Scraper Development (/forumdisplay.php?fid=60)
+--- Thread: TheTVDB.com Scraper absolute_number for Anime? (/showthread.php?tid=44667)

Pages: 1 2 3 4 5 6


- TullariS - 2010-04-18 19:29

chaoticmaster Wrote:I am trying to get a multi episode Samurai jack episode scanned correctly.

The episode name is Samurai Jack - 01-02-03.avi

XBMC scans the first episode correct and then scan 02 and 03 as the specials.

Is there another naming convention i should be using?

Found the same problem while updating my Naruto episode list. Looks like XBMC now scans episodes with forced season 1 correctly, but when doing the recursive scan for multipart episodes, it completely ignores the forced season.

Looks like this has to be fixed manually on the souce, at least until someone tracs this.

I'll stick the change here, just in case someone wants to have a go at recompiling.


- TullariS - 2010-04-18 21:00

Also, found a bug on the TVDB scaper, when fetching specials in absolute numbering mode.

Quote:<!-- If Using "absolute ordering" then scrape episodes without absolute_number with normal season/episode numbers to match Specials and other cases
-->
- <RegExp conditional="absolutenumber" input="$$1" output="<episode><title>\2</title><url cache="$$10.xml">$$2</url><epnum>\3</epnum><season>\5</season><id>\1</id><aired>\4</aired></episode>" dest="4+">
<expression repeat="yes"><Episode>.*?<id>([0-9]+).*?<EpisodeName>([^<]*).*?<EpisodeNumber>([0-9]+)[^<]*.*?<FirstAired<([^<]*)</FirstAired>.*?<SeasonNumber>(0)</SeasonNumber>.*?<absolute_number></absolute_number>.*?</Episode></expression>
</RegExp>

the bit in red is wrong, it should be:

Quote:<!-- If Using "absolute ordering" then scrape episodes without absolute_number with normal season/episode numbers to match Specials and other cases
-->
- <RegExp conditional="absolutenumber" input="$$1" output="<episode><title>\2</title><url cache="$$10.xml">$$2</url><epnum>\3</epnum><season>\5</season><id>\1</id><aired>\4</aired></episode>" dest="4+">
<expression repeat="yes"><Episode>.*?<id>([0-9]+).*?<EpisodeName>([^<]*).*?<EpisodeNumber>([0-9]+)[^<]*.*?<FirstAired>([^<]*)</FirstAired>.*?<SeasonNumber>(0)</SeasonNumber>.*?<absolute_number></absolute_number>.*?</Episode></expression>
</RegExp>

This makes this match fail completely.


- TullariS - 2010-04-19 13:34

TullariS Wrote:Found the same problem while updating my Naruto episode list. Looks like XBMC now scans episodes with forced season 1 correctly, but when doing the recursive scan for multipart episodes, it completely ignores the forced season.

Looks like this has to be fixed manually on the souce, at least until someone tracs this.

I'll stick the change here, just in case someone wants to have a go at recompiling.

Here is my DIFF:

Quote:Index: VideoInfoScanner.cpp
===================================================================
--- VideoInfoScanner.cpp (revision 29374)
+++ VideoInfoScanner.cpp (working copy)
@@ -885,12 +885,22 @@
{
season = reg.GetReplaceString("\\1");
episode = reg.GetReplaceString("\\2");
- myEpisode.iSeason = atoi(season);
- myEpisode.iEpisode = atoi(episode);
- myEpisode.cDate.SetValid(FALSE);
+ if (strlen(season) > 0 && strlen(episode) == 0)
+ { // no episode specification -> assume season 1
+ myEpisode.iSeason = 1;
+ if ((myEpisode.iEpisode = CUtil::TranslateRomanNumeral(season)) == -1)
+ myEpisode.iEpisode = atoi(season);
+ CLog::Log(LOGDEBUG, "adding new forced season 1, multipart episode %u", myEpisode.iEpisode);
+ }
+ else
+ { // season and episode specified
+ myEpisode.iSeason = atoi(season);
+ myEpisode.iEpisode = atoi(episode);
+ CLog::Log(LOGDEBUG, "adding new season %u, multipart episode %u", myEpisode.iSeason, myEpisode.iEpisode);
+ }
+ myEpisode.cDate.SetValid(FALSE);
free(season);
free(episode);
- CLog::Log(LOGDEBUG, "adding new season %u, multipart episode %u", myEpisode.iSeason, myEpisode.iEpisode);
episodeList.push_back(myEpisode);
free(remainder);
remainder = reg.GetReplaceString("\\3");



- jmarshall - 2010-04-19 22:16

I suggest factoring that out to a separate function rather than duplicating the code. Then post it on trac and cc spiff, AlTheKiller and myself.

Thanks!


- chaoticmaster - 2010-04-28 17:31

Where you able to scan episode 100 and above for Naruto? For me they get scanned as

#101 - Episode 1
#102 - Episode 2


- TullariS - 2010-05-08 17:45

chaoticmaster Wrote:Where you able to scan episode 100 and above for Naruto? For me they get scanned as

#101 - Episode 1
#102 - Episode 2

Hi

I used to get similar problems (#117 scanned as #17, etc). I made my own regexp for anime:

[\._ \-]([0-9]{2,3})()([\._\ \-][^\\/]*)

Or slightly simpler:

[\._ \-]([0-9]+)()([\._\ \-][^\\/]*)

The default regexp will not work for absolute numbering so you really need to use this one, or something along these lines.


- TullariS - 2010-05-08 17:47

jmarshall Wrote:I suggest factoring that out to a separate function rather than duplicating the code. Then post it on trac and cc spiff, AlTheKiller and myself.

Thanks!

Yes sounds good. Any suggestions on where should i place this function within VideoInfoScanner.cpp or any place will do?


- jmarshall - 2010-05-09 00:22

Anywhere in the file will do just fine.


- jmarshall - 2010-05-21 01:55

r30357 has a cleaned up version of your patch. Thanks.

Cheers,
Jonathan


- Hijo del sol - 2010-05-25 17:26

How do I implement this with my current SVN release? Do I have to stick all of my absolute numbered episodes into a "season 1" folder? Or do I rename all the files to season 1? or is there in option in "Set content" to enable absolute ordering?

Sorry for being such a dummy; I will pay it forward Rolleyes


- Hijo del sol - 2010-05-26 12:59

Nevermind; figured it out.

1. Set content>TVDB Settings>Absolute
2. Create Advancedsettings.xml
3. pull tv info again and boom. There it is.


Awesome!


- chaoticmaster - 2010-07-24 17:51

It worked. Thanks.


- chaoticmaster - 2010-07-24 17:52

TullariS Wrote:Hi

I used to get similar problems (#117 scanned as #17, etc). I made my own regexp for anime:

[\._ \-]([0-9]{2,3})()([\._\ \-][^\\/]*)

Or slightly simpler:

[\._ \-]([0-9]+)()([\._\ \-][^\\/]*)

The default regexp will not work for absolute numbering so you really need to use this one, or something along these lines.

It worked. Thanks.


- dandel - 2010-07-26 05:28

I started a bit of editing for the scrapers themselves to allow for querying the absolute number, however it's going to require a bit of work and fixes.... Look at bug #9723 on the xbmc trac website. However, this is work is not complete in any fashion.


- Celestialtorpor - 2010-08-15 00:58

This is great!

..Sort of.


I'm not sure what I did, but following the suggestions in this thread to allow certain animes over 100 episodes to show up properly, I implemented:

<advancedsettings>

<tvshowmatching>
<regexp>[\._ \-]([0-9]{2,3})()([\._\ \-][^\\/]*)</regexp>
</tvshowmatching>

</advancedsettings>


Only now *every* show with more than 1 season will not show the subsequent seasons.

Is there any way for me to have my cake and eat it too?