VideoLibrary.Scan with path as parameter not working
#1
I need to scan a specific path for new Episodes.
A complete scan without the directory parameter works. But using this rpc I dont see any new Videos in my Library. Which I should.
Code:
{"jsonrpc":"2.0","method":"VideoLibrary.Scan","params":{"directory":"/home/pi/NewEpisodes"}}
Reply
#2
Experienced the same. Maybe make a trac ticket out of it?
http://trac.xbmc.org/
Reply
#3
It works for me. I can pass a directory to the Scan method and it only scans that one folder, not all sources. I've confirmed via watching the xbmc.log (and seeing my newly added movie scraped).
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.Scan", "params": {"directory":"/home/movies/DVD"},"id": 1}
Reply
#4
Here's how to reproduce:

It only applies to tv (the video scanner run different algorithm based on content type https://github.com/xbmc/xbmc/blob/master...r.cpp#L305 )

1. Make a directory structure like this

Code:
./MyTv
    /SomeShow
        /Season x
            SomeShow S01E01.mkv

2. Place a new file in «Season x» folder
3. Run a parameterized scan as in OP on «MyTv»
The «Season x» folder is important. If you place the file here it doesn't work; if you place it in «SomeShow» it works as expected
Reply
#5
I think this is why it fails: https://github.com/xbmc/xbmc/blob/master...r.cpp#L368 It does not check recursively for tv show, and the top level path will be skipped because hash only see 1 level down. The comment says "we have already looked recursively for episodes" but that's clearly wrong. Not even sure what that's supposed to mean. Perhaps some code have been removed, or the directory layout for tv show have been relaxed since then.(?) But there's other issues as well. Like all 'items' being cleared, 'settings.recurse' is forced to 0 when content is tv. I don't know, maybe I completely misunderstood something here.

If you don't specify a path, it adds all recursively here https://github.com/xbmc/xbmc/blob/master...r.cpp#L175 that's why it works.
Reply
#6
Experiencing the same.

This has nothing to do with the update XBMC 12.2 changelog "Ability to scan for new content on file folders has been reimplemented" does it?
Reply
#7
I see this behaviour with movies, it's been like this since 12.0.

If my source is "/mnt/share/movies", and I have movies in the root of this source, and also movies in a "sets" sub directory (eg. "Back to the Future"), then I can successfully scan the "/mnt/share/movies/Back to the Future" directory and XBMC will find all the new items. However, if XBMC is asked to scan the directory "/mnt/share/movies" (ie. the root folder of the source) then it will fail to find any new items, but the same scan, with a null directory, will find new items.

Scanning directories "/mnt/share/movies" and "" should produce similar (identical?) results, but the former doesn't work, while the latter does. The only thing special about the directories that don't work, is that they are the root of each source - sub directories always work without fail.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#8
(2013-05-05, 04:37)dkasper Wrote: Experiencing the same.

This has nothing to do with the update XBMC 12.2 changelog "Ability to scan for new content on file folders has been reimplemented" does it?

You mean https://github.com/xbmc/xbmc/commit/5328...93bea3eb5d ? Then no. Actually, it might be affected by this bug as well.
Reply
#9
(2013-05-05, 04:57)MilhouseVH Wrote: I see this behaviour with movies, it's been like this since 12.0.

If my source is "/mnt/share/movies", and I have movies in the root of this source, and also movies in a "sets" sub directory (eg. "Back to the Future"), then I can successfully scan the "/mnt/share/movies/Back to the Future" directory and XBMC will find all the new items. However, if XBMC is asked to scan the directory "/mnt/share/movies" (ie. the root folder of the source) then it will fail to find any new items, but the same scan, with a null directory, will find new items.

Scanning directories "/mnt/share/movies" and "" should produce similar (identical?) results, but the former doesn't work, while the latter does. The only thing special about the directories that don't work, is that they are the root of each source - sub directories always work without fail.

Sounds different from what's discussed here. The recursion bug definitely only affects tv-show. I've checked.

Anybody reported this on trac btw?
Reply
#10
Hi,

It took me ages to find the right syntax for my samba shared TV shows folder. I want my script to update only the new folders each time one is added. My Video source is mounted as:
smb://SSERVER/data/Videos/Temp
This video source is listed as containing "TV shows" and has the TVdB scraper assigned to it. Shows are stored in smb://SSERVER/data/Videos/Temp/ShowName/Season XX/TVShow.mkv structure. ALL of my TV shows are stored in this format

I use the python module jsonrpclib:
If I call server.VideoLibrary.Scan(), it will scan ALL video source and pick up ALL new episodes.

If I call server.VideoLibrary.Scan(directory="smb://SSERVER/data/Videos/Temp/ShowName/Season XX/") (note the trailing slash) I get an error " No information found for item 'smb://SSERVER/data/Videos/Temp/ShowName/Season XX/', it won't be added to the library."
If I call it with .../ShowName/Season XX (without the trailing slash) I get a similar if not identical error
If I call it with .../ShowName (without the trailing slash) I get a similar if not identical error

If I call .../ShowName/ (with a trailing slash) it WORKS, this is the only format I have found for specifying a TV show directory that actually scans properly. If I specify ShowName/ with a traiing slash, but missing off the lower season number directory it works.

Does anyone know why this is? I'm assuming it must be something to do with the way the scraper scans for video files and does/doesn't recurse properly into lower directories

Thanks
Reply
#11
(2013-12-08, 02:40)wassy Wrote: Does anyone know why this is? I'm assuming it must be something to do with the way the scraper scans for video files and does/doesn't recurse properly into lower directories

Maybe the problem is with jsonrpclib.

What happens if you try the same paths with the vscan option of the script in my signature? Enable logging with @logfile=</path/to/logfile.log> and check the log for requests/responses.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#12
Hi.

No it is not jsonrpclib. I have tried formatting the actual JSON serialized strings and sending them using the "RESTClient" plugin for Firefox, I get the same results when I manually type out the JSON RPC string in this way.
Reply
#13
nfs://192.168.0.3/mnt/share/media/Video/TVShows/Arrow
nfs://192.168.0.3/mnt/share/media/Video/TVShows/Arrow/
nfs://192.168.0.3/mnt/share/media/Video/TVShows/Arrow/Season 1
nfs://192.168.0.3/mnt/share/media/Video/TVShows/Arrow/Season 1/

All work for me, no errors (using vscan option of script from sig).

Testing with very latest Gotham master (built from git).

Really need to see the request and responses your library is processing.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#14
(2013-12-08, 16:16)MilhouseVH Wrote: nfs://192.168.0.3/mnt/share/media/Video/TVShows/Arrow
nfs://192.168.0.3/mnt/share/media/Video/TVShows/Arrow/
nfs://192.168.0.3/mnt/share/media/Video/TVShows/Arrow/Season 1
nfs://192.168.0.3/mnt/share/media/Video/TVShows/Arrow/Season 1/

All work for me, no errors (using vscan option of script from sig).

Testing with very latest Gotham master (built from git).

Really need to see the request and responses your library is processing.

Here is a link to the output of my texturecache.py log: http://pastebin.com/h1jFBdry
And here is the accompanying xbmc log extract: http://pastebin.com/yYndmCxB

The first time worked by specifying the folder:

.../SeriesName/ - I deleted all items from the library and tried with other variations.
.../SeriesName/SeasonNo/Filename.ext - didnt work
.../SeriesName/SeasonNo/ - didnt work
.../SeriesName/SeasonNo - didnt work
.../SeriesName - didnt work

Note, my folder structure never changes, it has always been //SSERVER/data/Videos/Temp/Game Of Thrones/Season 3/<Files>
Reply
#15
When you say you deleted "all files from the library" after the first successful scan, did you delete the tv show from the library too (and clean)? Scanning a season, or a specific episode of a season, for a non existent tv show isn't likely to work, but adding a new season or episode to an existing show should work.

However, be aware of fast hashes and how xbmc will ignore scan updates unless a directory hash has changed - enable debugging to see this information in the xbmc log. This could very well explain why subsequent scans found no updates.

Try an incremental scan by first scanning Game of Thrones (without Season 3 files), then add the Season 3 files (without episode 10) and scan Season 3, then finally add the episode 10 file(s) and scan just episode 10.

One other important point to note is that in your tests there were no "errors", so any error being reported by your jsonrpc library is not being returned from xbmc itself.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply

Logout Mark Read Team Forum Stats Members Help
VideoLibrary.Scan with path as parameter not working0