Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan only new & changed files #843

Closed
RandomBloke85 opened this issue Apr 6, 2021 · 3 comments
Closed

Scan only new & changed files #843

RandomBloke85 opened this issue Apr 6, 2021 · 3 comments

Comments

@RandomBloke85
Copy link

Hello

First thank you for developing this fantastic app.

If I understand the scanning options correctly, it is only possible to either scan everything fresh or rescan an already build database, right? It would be great, if it would be possible to only rescan those files, which have either been added, deleted or retaged, in other words modified since the last scan. That should be a lot faster then.

Thank you

@paulijar
Copy link
Collaborator

paulijar commented Apr 6, 2021

Hi,

Are you now talking about the scanning options available on the command line via occ music:scan? There, the default scan mode is to scan those audio files which are not already part of the music library. This can be changed with the option --rescan which causes also previously scanned files to be rescanned. Furthermore, there is the option --clean-obsolete which can be given to remove any dangling references to already removed files.

Normally, there should be no need for manual scanning after your library has been scanned once: The Music app observes any changes in the file system and automatically scans the new files, removes the deleted files, and rescans the changed files. However, there are a few edge cases when using the sharing feature or external storages which may cause the Music library index to get out-of-sync with the file system. But even then, the simple occ music:scan with no additional options should be able to solve most of these cases.

The option --rescan should be rarely needed and it has been intended to be used in cases where a new Music app version scans more information from the files than the previous versions. Like when the support for scanning and displaying genres was added in v0.14.0. At that time, library scanned with an older version could not show the genres even on the new app version, but the rescan could be run to enable the genre support.

If you still find out that for some odd reason a file update has been missed by Music, and you want to rescan to solve this, then you can also target some specific folder (and its subfolders) by specifying the option --folder=<target>.

@RandomBloke85
Copy link
Author

RandomBloke85 commented Apr 6, 2021

Alright, thank you for the explanation.

I've modified some files (only the ID3tags), and run occ music:scan. Result: Found 0 music files to scan in

When I point to a specific directory, I get the same result.

But my media folder is on Truenas and mounted as external storage. So maybe the database is out of sync. Not the end of the world, I could still run a --rescan. It just takes a little longer but get's the job done.

Thank you

paulijar added a commit that referenced this issue Nov 7, 2021
It is now possible to use the command `occ music:scan
--rescan-modified` to rescan those files which have modification time
later than the time when the corresponding track item in the database
was last updated.

refs #843
@paulijar
Copy link
Collaborator

The new Music release v1.5.0 now brings the option --rescan-modified for occ music:scan. With this, the app rescans those files which have modification timestamp newer than the time when the file was previously scanned. Note that this mode doesn't scan any new, previously unscanned, files; those can be scanned separately by invoking occ music:scan with its default options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants