All concurrency from other threads should pass through the viewContext's
performBlock or performBlockAndWait functions, and no other way. So now,
all access to Core Data is either happening on the main thread, or by
using these code blocks, all of which will wait for their access to
proceed.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This should fix up potential locking issues with maintaining a copy of
the results set while certain other background actions may happen, such
as the player updating play counts while playing.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CUEs will now deduplicate playlist entries based on their dependencies,
and prevent loading redundant tracks if you add an entire directory, or
use the option to add a directory when adding single files from it.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The subdirectory parser, the CUEsheet reader, and the legacy XML
playlist reader were missing grants for Sandbox access.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Deduplicate loaded tracks, to prevent duplicate items when adding a
folder that happens to contain playlists or CUE sheets referencing the
very same files.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Only ask permission for container folders if the container has local
files, and not for purely remote files, such as stream playlists.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Playlist View pasteboard copier function should only be generating URLs,
and it should verify that the entry has a valid URL to begin with.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
In case the current track isn't part of an album, or is otherwise not
matching any albums in the playlist. Though the Album filter predicate
wasn't working for a while due to changes.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Apparently we need this to prevent Core Data from stomping on itself
when another thread accesses it.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Insertions which occur when the playlist is filtered can try to add past
the end of the playlist. Let's try to dodge that.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Oops, I should have remembered that the data structure changes would
break this search predicate. Now apply the search predicate to the
playlist representation, which allows searching against the data blocks
using the PlaylistEntry property implementation.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This redesign completely changes how tags are stored in memory. Now all
arbitrary tag names are supported, where possible. Some extra work will
be needed to support arbitrary tags with TagLib, such as replacing it
with a different library.
Translation pending for a couple of strings.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Disable the compiled in AVIF support there, as the OS supports it
natively. Keep the libraries for older OSes.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Ask for permission to access the folders containing container files,
such as .CUE sheets, or .M3U or .PLS playlists.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
- Plugs the Total duration text to macOS's localization technology
- Adds a proper Spanish translation
- Adapts certain dialogs to make them more suitable for translation
Signed-off-by: Kevin López Brante <kevin@kddlb.cl>
Process main queue messages by handling the loading in a background
queue, and sync it to the main thread periodically, while pausing to
wait for the results. This allows the file open dialog to return
immediately, and display loading progress on the status bar.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Fix counts for tracks with subsongs from piling all the counts onto the
first subsong seen, by using the URL fragment in the filename check and
storage.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Tabulate first seen information when loading the metadata, rather than
when first adding the tracks to the playlist. This should fix first seen
information when metadata is available, as the information will be
useless without track titles.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Commit only once the entire batch is loaded and processed. Also commit
using the correct function.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The playlist was being pruned of entries marked for deletion, but they
were not being pruned from the set that was then added to the player.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The Path Suggester will now automatically open when new files are added
to the playlist and a given path is not in the sandbox settings. It will
also pop for both the File Tree and MIDI SoundFont path configuration
settings being changed.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
All optional fallback code for older versions has also been removed, and
everything now assumes 10.13.0 or newer. Some cases are still included
for point releases, such as 10.13.2.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This needs to be called on the main thread, as something may or may not
be enumerating over the data while this thread decides to call it.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Do not clear the progress indicator if a loading task is already running
in the background, but instead return without doing anything.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Refine the global variable usage, eliminating double underscore prefixes
and trusting that static global variables will exist in the object where
the class was created. Got rid of that nasty NSApplication extension
hack that was previously in use.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>