Commit Graph

34 Commits

Author SHA1 Message Date
Jim Broadus 3bd15aea0d library: Add option to ignore files by extension
Add a new skip option in library settings that takes a comma separated
list of file extensions. Skip files with the specified extensions when
scanning the library.
2021-03-14 14:00:03 +00:00
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +01:00
Jim Broadus feaca363a7 Remove directory by id.
Eliminate need to create temporary Directory object when removing a directory.
2020-01-25 18:22:16 -08:00
Jim Broadus 1c6e43509c Cancel scan when directory is removed.
When a directory is removed from the library during a scan, the scan continues
until complete. This change cancels the scan immediately, unblocking the watcher
thread, then signals the watcher to remove the directory.

A second issue occurs when a previously scanned device is removed during a
scan. All remaining files will be marked as deleted. This change mitigates
this issue, but a timing hole still remains here.
2020-01-24 10:28:51 -08:00
Jim Broadus c40a1f7738 Pass album_art map to ImageForSong as pointer instead of reference.
Requested as part of PR 6543.
2020-01-23 09:15:39 -08:00
Jim Broadus 4ebd3c8c0a Add ability to cancel scan per directory.
Store a boolean along with watched directories to indicate active. Use this flag
to provide a mechanism to halt scans on a per-directory basis.
2020-01-23 09:15:36 -08:00
Jim Broadus 52c3ce70ea Pass a Directory reference to ScanTransaction instead of a directory id.
This is can be done without protecting the directory reference since the method
that removes directories from the watch list is only called on the same thread
as the scan, and never during the life of the ScanTransaction object.
2020-01-21 17:27:01 -08:00
Jim Broadus 34a2e86b4b Handle FileSystemWatcherInterface::AddPath errors.
On Linux systems, failure to watch a path may be caused by the limit set in
/proc/sys/fs/inotify/max_user_watches. This can be demonstrated by creating
a directory with a large number of empty subdirectories and adding that test
directory as a library.

Check that a file is readable before adding a watch. If adding the watch fails,
report the error to the user only once. Only add the path to subdir_mapping_
if watch succeeds.
2020-01-17 16:26:09 -08:00
Jonas Kvinge ca18a5584d Fix formatting 2019-11-12 20:05:53 +01:00
Jonas Kvinge fd35f20d26 Remove watch for removed subdirectories 2019-11-12 19:55:48 +01:00
John Maguire 192b60d965 Use nullptr as parent parameter default everywhere 2014-02-10 16:03:54 +01:00
John Maguire bebd781fdf Reformat all non-3rd-party C/C++/Objective-C++.
Command line:
find src ext -regex '.*\.\(h\|cpp\|mm\)' -exec clang-format -i
 -style='{BasedOnStyle: Google, DerivePointerBinding: false}' {} \;
2014-02-07 16:34:20 +01:00
Gregor Tätzner 7317b6792e don't rescan unchanged files if library has been unavailable 2014-02-01 20:21:28 +01:00
David Sansome facb366017 Remove subdirectory watches after a directory is removed from the library. Otherwise subdirectories that changed after the directory was removed would be re-scanned and re-added. 2012-01-29 17:39:28 +00:00
David Sansome d4b4606068 Create the FilesystemWatcherInterface directly in the LibraryWatcher, fixing a crash when trying to add a new device. 2012-01-08 18:37:46 +00:00
John Maguire 483c36748e const& and tweaks to Mac directory canonicalisation. 2012-01-05 16:11:39 +00:00
John Maguire 761737eb4d Add more robust subdirectory detection in LibraryWatcher. 2012-01-05 15:56:46 +00:00
John Maguire 9fdfb52225 Use FSEvent-based filesystem watcher on Mac. 2012-01-05 14:51:23 +00:00
Paweł Bara 832b258b55 me no speaky english 2011-02-17 20:04:58 +00:00
Paweł Bara 20658989c3 full library rescan feature - should already work as expected 2011-02-17 19:57:14 +00:00
Paweł Bara ddd3f119d3 CUE songs are now properly updated in library - you can delete a CUE sheet, add it, you can change section markers in it etc. and everything should work as expected
Song now knows it's cue path (if any)
2011-01-15 18:46:23 +00:00
Paweł Bara 4f7e804638 library: watcher now updates CUE associated songs + ignores the not-CUE-associated songs in a CUE sheet
CueParser: properly update length for the last song from every FILE in multifile CUE sheet
new 'playlist_path' argument in the 'Load' part of PlaylistParser's API
2011-01-11 23:09:59 +00:00
Paweł Bara da5f941333 consider .cues when scanning the library
persist the new 'beginning' marker of songs
fixed a bug where %allsongstables script would not update the attached databases
2010-12-28 15:36:01 +00:00
David Sansome 1362809b5d Make the library scanner use filter words for selecting cover art. Thanks markwatkinson. Fixes issue #634 2010-12-28 12:52:58 +00:00
David Sansome ed1a25693c Add missing licenses to debian/copyright, and add copyright information to each source file 2010-11-20 13:27:10 +00:00
David Sansome d620779696 Add an option to disable directory watchers 2010-07-10 17:03:28 +00:00
David Sansome 2762d80722 Show the scanning progress in the device view 2010-07-04 15:56:08 +00:00
David Sansome 2deca7fd61 Add a DeviceManager which holds all the listers and connected devices. Make FilesystemDevices use their own LibraryWatcher. 2010-06-26 12:41:18 +00:00
David Sansome 05b6c8fe71 Allow organising of whole directories, and pause the library watcher while organising is in progress. 2010-06-24 21:46:18 +00:00
David Sansome 44d58482f0 Make the LibraryWatcher report on its progresss. Fixes issue #436 2010-06-23 14:00:18 +00:00
David Sansome f808591ec7 Refactor the loading indicator widget into a seperate TaskManager class that can handle tasks with progress 2010-06-23 13:21:30 +00:00
David Sansome c834a5f31f Do the compilation processing in the database thread, and make everything lock on the database to ensure two threads don't access it at once. 2010-06-02 16:22:20 +00:00
David Sansome 0021e5f7e4 Make library scanning on startup optional, and add a menu item to update the library. Fixes issue #341 2010-05-25 20:40:45 +00:00
David Sansome 1aee5e4667 Split all the source files up into seven new directories. 2010-05-10 21:50:31 +00:00