how to force a re-scan of media

For help and support with Universal Media Server in general
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
asdffdsa6131
Posts: 5
Joined: Sat Apr 11, 2020 6:21 am

how to force a re-scan of media

Post by asdffdsa6131 »

hello and thanks,

since my media is stored in the cloud and accessed via a rclone mount.
a full scan is very expensive in terms of time and resources.
and polling is not support on a rclone mount.

so via the command line, how can i get ums to do a quick scan for new media only.
i do not want ums to re-scan existing media that is already stored in the cache.
as that would trigger ums reading inside the media files, thus causing a lot of data to be downloaded from the internet.

thanks much,
Nadahar
Posts: 1900
Joined: Tue Jun 09, 2015 5:57 pm

Re: how to force a re-scan of media

Post by Nadahar »

You can't give UMS "commands" from the command line - there's no mechanism to receive such information. You can use the "web console" (if you can find it, look in the log for the address) to trigger a rescan. It's not possible to scan new media only specifically, although this is in theory what is always done. The file path and the "last change" timestamp is stored in the database. The shared folders are scanned for files and folders, but the media itself isn't analyzed if an entry with the same file path and timestamp already exists in the database. Instead, the information in the database acquired in the last scan is used.

It the timestamps don't stay the same, or the paths vary, a new analysis will be triggered though.
asdffdsa6131
Posts: 5
Joined: Sat Apr 11, 2020 6:21 am

Re: how to force a re-scan of media

Post by asdffdsa6131 »

thanks,

it is a big issue for me, as my media is in the cloud, accessed via a rclone mount.
so a full scan, in terms of time and data downloaded, is a real issue.

i thought i had done a test of the re-scan and found that ums was re-scanning existing data.
i will test again.

i customized the ums.conf file, to disable any features about generating thumbnails or meta data or anything that would have ums read the contents of a media file.
is there a flag or setting that will prevent ums from reading the contents of the media files?

thanks
Nadahar
Posts: 1900
Joined: Tue Jun 09, 2015 5:57 pm

Re: how to force a re-scan of media

Post by Nadahar »

You can't prevent UMS from analysing the files, or UMS would have no idea what to do with them. It normally won't read the whole file though, just enough to get the information it needs (usually just the headers). There are some files though (MP4 for example) that has the brilliant idea that they place the headers at the end of the file, which could pose problems. UMS won't actually "read" through the whole file, it will try to seek/skip to the interesting part, but this depends on that the underlying I/O actually supports seeking/skipping. I know that poor implementations actually just "reads and throws away" all the data behind the scenes when seeking, so if your rclone mount system is of this "primitive" type, it could mean large downloads.

Without knowing the details of the media files, UMS can't handle them, it's simply impossible, so UMS needs to get this information one way or another.
asdffdsa6131
Posts: 5
Joined: Sat Apr 11, 2020 6:21 am

Re: how to force a re-scan of media

Post by asdffdsa6131 »

thanks much,

did more testing.
1. the amount of data read by ums is very small and rclone only downloads the requested data.
2. i am finding that each time i re-start ums, when it does a re-scan on startup, ums always re-downloads data.
i have no idea why and i did look at the debug log, did not see anything but not sure what to look for.
3. seeing this in the log file

Code: Select all

DEBUG 2021-04-21 21:53:51.207 [Library Scanner] Error adding child: "shoah.part.2.1985.1080p.bluray.x264-geckos.sample.mkv"
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:659)
	at java.util.ArrayList.get(ArrayList.java:435)
	at net.pms.dlna.RealFile.getFile(RealFile.java:160)
	at net.pms.dlna.RealFile.checkThumbnail(RealFile.java:350)
	at net.pms.dlna.RealFile.isValid(RealFile.java:123)
	at net.pms.dlna.DLNAResource.addChild(DLNAResource.java:502)
	at net.pms.dlna.MapFile.manageFile(MapFile.java:267)
	at net.pms.dlna.MapFile.analyzeChildren(MapFile.java:335)
	at net.pms.dlna.RootFolder.scan(RootFolder.java:278)
	at net.pms.dlna.RootFolder.scan(RootFolder.java:288)
	at net.pms.dlna.RootFolder.scan(RootFolder.java:288)
	at net.pms.dlna.RootFolder.scan(RootFolder.java:288)
	at net.pms.dlna.RootFolder.scan(RootFolder.java:244)
	at net.pms.dlna.DLNAMediaDatabase.run(DLNAMediaDatabase.java:1663)
	at java.lang.Thread.run(Thread.java:748)
Post Reply