And folders of tracks, too! The only thing that worked in 3117 was
playlist files. Hah!
Fixes#436
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Files are now loaded to unique keys, and containers such as playlists
and CUE sheets maintain their file order. Deduplication now only applies
to top level files and not playlist contents. Sorting applies to top
level files, and playlist or container names, but not their contents.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Operation blocks cannot expect their out of scope variables to be
present when the block executes, so design the block operation to pull
inputs from a queue array one at a time, like the rest of the blocks do.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Option to make selection follow the playback, within the lag of the
output buffer, including if Always Stop After Current or Repeat One is
enabled. Allows easily queueing up a list of tracks in Always Stop mode,
then hitting the Play button again to play the next track. Enabled by
default, but always optional to disable.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
A new menu option under the Control menu, disabled by default, which
stops playback after the current track completes.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Perform the file container checks in an operation queue, since those are
a major bottleneck at this point, too.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Playlist Loader was sorting only the non-container tracks, and not the
final track list. Move the sort operation to the end of the processing.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Add event traces to playlist loading and metadata processing queues.
Unfortunately, most of the old non-error events should not be logged,
because Sentry gets terribly spammy with captureMessage events. They
should only be used for error events, or other uncommon events which
do not already throw exceptions or NSError objects.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Sometimes the play count data only includes the filenames, and thus will
fail a query for just the tags. Also, a file query may be stored without
the subsong fragment tag, which will also break the tags.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Play Count sorting was entirely missing, and sample rate and bits per
sample sorting caused exceptions due to the capitalization of the fields
versus the column identifiers.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
When adding tracks to the playlist, clear the search filter first, so
the playlist doesn't become all jumbled, or so we don't overflow the
playlist indexes.
Also add some bug fixes for reversing the arranged to disarranged index
lists, so if an arranged index is past the end of the arranged list, as
is the case for appending, we shift the indexes forward past the end of
the diarranged object list.
Extra exception handling was added as well, so these things will only
cause a failure to add playlist items at worst, instead of crashing the
player entirely.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
In case playlist setup is reset or not, move the reset above the menu
setup code, so the menu is set up correctly if a reset occurs.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Reset to defaults if no columns are visible. Also log this situation in
Firebase events, in case it becomes relevant.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Play Count cannot be updated for tracks which have been deleted before
the update was added to them. This was another cause of a rare crash.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
You will need to reset your settings after this, but then it should
stay put for the indefinite future.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
It should also be possible to sort by the column, ascending or
descending. This also necessitated adding playlist row refreshing
for play count updates.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Default repeat mode should now be Repeat All, and the menu items should
now all function, fixed by removing a bunch of pointless attributes from
each affected menu item.
Fixes#371
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Merge the existing metadata entry dictionary with new values, because
sometimes, the caller may pass us a dictionary with some fields missing.
Fixes stream metadata for many HTTP streams.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
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>