Commit Graph

441 Commits (e6c3fcaa0d436830939d7208d4508599743000ee)

Author SHA1 Message Date
Christopher Snowhill 3c86758cb5 [Sandbox] Ask for permission for container folders
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>
2022-07-03 22:40:26 -07:00
Kevin López dd20073a9b [Translation] The Big Translation Commit
- 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>
2022-07-01 12:37:30 -07:00
Christopher Snowhill 82179a5f10 [Sandbox] Support bookmarking individual files
Individually added files, directly opened by the user, may now store
bookmarks in settings.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-29 11:56:50 -07:00
Christopher Snowhill f5bde75eda [Sandbox] Automatically save folder bookmarks
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-28 23:13:42 -07:00
Christopher Snowhill 22085d94f1 [Sandbox] Show grant dialog on launch if empty
If there are no configured paths, show the grant page on every startup.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-28 22:58:13 -07:00
Christopher Snowhill de7afad3d4 [Playlist Loading] Process messages while loading
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>
2022-06-28 20:26:55 -07:00
Christopher Snowhill 44fb1efc73 [Play Info] Implement track rating system
The track ratings are stored in the same stats table as the play counts.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-28 01:59:36 -07:00
Christopher Snowhill 8fc981cb92 [Play Counts] Add option to (mass) reset counts
Add option to reset counts for all selected tracks on the playlist.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-28 01:59:10 -07:00
Christopher Snowhill de43192453 [Play Counts] Commit play count edits to storage
Was calling commitEditing rather than commitPersistentStore, whoops.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-28 01:59:00 -07:00
Christopher Snowhill 5c4cfb4053 [Play Counts] Fix counts for tracks with subsongs
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>
2022-06-26 04:38:18 -07:00
Christopher Snowhill 4bc4b38489 [Play Count Info] Tabulate first seen info later
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>
2022-06-25 02:40:49 -07:00
Christopher Snowhill ec91f61403 [Metadata] Commit first seen date for whole batch
Commit only once the entire batch is loaded and processed. Also commit
using the correct function.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-24 17:09:06 -07:00
Christopher Snowhill 6d772562ca [Core Data Store] Fix startup playlist pruning
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>
2022-06-24 00:52:33 -07:00
Christopher Snowhill ba33218ddf [Path Suggester] Automatically pop where required
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>
2022-06-24 00:52:03 -07:00
Christopher Snowhill 2c2a058126 Cog now requires macOS 10.13 as a minimum version
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>
2022-06-23 23:23:07 -07:00
Christopher Snowhill b2c354a32c Serialize persistent store update to main thread
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>
2022-06-22 19:11:06 -07:00
Christopher Snowhill 6867ef1e9a [Playlist Info Loader] Do not clear if loading
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>
2022-06-22 19:06:10 -07:00
Christopher Snowhill 5cb08291bf [Sandbox / Core Data] Refine global variable usage
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>
2022-06-21 00:01:07 -07:00
Christopher Snowhill d20df5164f [Metadata Loading] Make metadata loading smarter
Metadata loading now filters the request list down to unique file paths
that don't have metadata loaded, makes sure that another instance of the
loader isn't already loading the same files, and waits for previous
instances to complete before beginning another metadata load task. It
also will update the playlist entries for all affected tracks, even if
they were not explicitly selected for loading or reloading.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-20 23:22:07 -07:00
Christopher Snowhill 4330226776 [Core Data Store] Fix empty URL filtering
Empty URL filtering was implemented incorrectly. Fix that.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-20 23:18:37 -07:00
Christopher Snowhill c89837c0f8 [Play Count] Remember added count across sessions
Remember if play count was already tracked for the current file across
restarts, if resume playback after restart is enabled.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-20 19:13:33 -07:00
Christopher Snowhill c23bece62c Reintroducing App Sandbox, and more
- Implemented App Sandboxing in a more friendly manner.
- All sandboxed paths will need to be set in Preferences. Set as loose
  a path as you want. The shortest path will be preferred.
- Removed Last.fm client support, as it was non-functional by now,
  unfortunately. Maybe something better can come in the future.
- Added support for insecure SSL to the HTTP/S reader, in case anyone
  needs streams which are "protected" by self-signed or expired
  certificates, without having to futz around by adding certificates to
  the system settings, especially for expired certificates that can't
  otherwise be dodged this way.

If you want to import your old playlists to the new version, copy the
contents of `~/Library/Application Support/Cog` to the alternate sandbox
path: `~/Library/Containers/org.cogx.cog/Data/Library/Application `...
...continued...`Support/Cog`. The preferences file will migrate to the
new version automatically.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-20 03:35:29 -07:00
Christopher Snowhill 385335b37c [Core Data Storage] Refine deleted/empty items
Remove empty items also with empty URL fields.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 20:04:30 -07:00
Christopher Snowhill 163ae5c864 [Core Data] Optimize queue and shuffle loading
Optimize queue loading code, and add shuffle list reading code.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 02:05:26 -07:00
Christopher Snowhill 7fcfdb373b [Playback Status] Remember last play position
Remember last play position in the playlist, rather than using an index
variable to store its position and play time. Still store whether the
player was last playing in a configuration variable, though.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 01:42:27 -07:00
Christopher Snowhill 636fefaf6f [ReplayGain Info] Info strings are now localized
The strings are now part of the localized strings storage, which is
still awaiting a volunteer to add more translations to the app.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 23:45:18 -07:00
Christopher Snowhill a0a5106e51 [Play Counts] Now correctly reports last seen time
Correctly reports last seen time, instead of reporting the first seen
time twice.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 23:44:29 -07:00
Christopher Snowhill 84d0cbee3c [Playlist Controller] Remove unused function
Remove a leftover function from previous code.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 23:01:11 -07:00
Christopher Snowhill a2d8e0ec42 [Track Info] Add play count tabulation and display
Add play count data collection, including first seen times for every
file first added to the playlist. Data is indexed by album, artist, and
title, or by filename, whichever matches first. Add interfaces to
AppleScript automation definition as well.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 23:00:08 -07:00
Christopher Snowhill 8cb46b4f15 [Legacy SQLite Store] Handle errors with database
Handle missing track items in the databse more gracefully, by deleting
the track entries before passing them on to the caller, so problems do
not occur later.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 18:41:14 -07:00
Christopher Snowhill 41d4c7458e [Translations] Load PlaylistEntry error messages
These error messages should be loaded from the main bundle, where the
class is located.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 16:16:43 -07:00
Christopher Snowhill ecb30dd734 [Translation Support] Update strings a bit.
Update the strings, and remove the comments where they won't be used.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 16:10:18 -07:00
Christopher Snowhill 1c2ecc1c7c [Playlist] Handle invalid files in a better way
Invalid files may include nil URLs, which should be skipped or stop
playback altogether. Invalid files will be marked as an error, and
stop playback.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 16:09:41 -07:00
Christopher Snowhill 54b102f09e [Playlist] Fix refresh handling range
Apparently, somehow, indexes in obscene ranges hit this code, and cause
exceptions. Strange.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 15:50:25 -07:00
Christopher Snowhill 88b7cd6352 [Crashlytics] Added logging of track events
Added logging of track metadata load and track playback events, to aid
with crash logging.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 22:34:51 -07:00
Christopher Snowhill 4b4776fbc0 [Shuffle Function] Make album predicate exact
Make the album match predicate an exact match, rather than using the
"like" operator, in case there's a speed up from doing so.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 17:25:42 -07:00
Christopher Snowhill e9b02d54f4 [Core Storage] Apply index sort to fetch request
Apply the index sort to the fetch request itself, rather than applying
it to the resulting array afterward.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 17:20:45 -07:00
Christopher Snowhill cad6ddac02 [Shuffle Function] Greatly optimize list generator
The list generator now selects only a list of unique album names, which
may include empty string as well as NSNull, so filter those as well.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 17:03:50 -07:00
Christopher Snowhill 9820571a94 [Shuffle Function] Rewrite query for Core Data
Rewrite the album filter function to apply the filter predicate against
Core Data directly, which also requires filtering out deLeted entries so
they don't end up in the results, and also requires sorting the results.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 17:02:24 -07:00
Christopher Snowhill a0761a41c9 [Playlist Metadata] Safety check for deletion
Apply a safety check in case the update comes for a deleted track.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 10:25:27 -07:00
Christopher Snowhill c7cd9b6daf [Playlist Metadata] Apply metadata correctly
Apply dynamic metadata update refreshes to the correct track index.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 10:24:45 -07:00
Christopher Snowhill ab32365c45 [PlaylistEntry] Fix a single warning
Fix a warning about nullability of a class member.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 10:22:31 -07:00
Christopher Snowhill 39f4d09c1a Use NSNumber Literals as much as possible
Replaced a bunch of [NSNumber numberWith...] with NSNumber Literals.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 06:39:02 -07:00
Christopher Snowhill d972a6eaf5 [Playlist] Correctly handle deleted items
The member that I set myself to indicate deletion has one capital letter
to differentiate it from the built-in "delete" property of managed
objects, which doesn't do what I want, so I had to dodge it with that
capitalization thing.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 04:34:17 -07:00
Christopher Snowhill 4e782807d8 [ReplayGain / Volume] Fix default volume value
Fix the default volume scale reading for newly added tracks, as this
value should be 1 for any files which do not have tags. Also add an
override to the tag applying function, to reset the default on tag
re-read operations.

Please reload the tags or re-add your files to fix them playing
silently.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-16 23:31:34 -07:00
Christopher Snowhill 789e8e432e [Playlist Storage] Add another compatibility hook
Add a compatibility getter/setter for URL, which was renamed to url, due
to Core Storage having a requirement of all attributes starting with a
lower case letter.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-16 17:43:48 -07:00
Christopher Snowhill c71021fc9b [Metadata] Fix assigning Unsigned property
The PlaylistEntry class needs a compatibility wrapper for the Unsigned
member, as it is assigned by all of the inputs. Case sensitivity and all
that is. And unfortunately, Core Data requires all model members to
start with a lower case letter.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-16 17:05:52 -07:00
Christopher Snowhill 72c4dddf18 [Clipboard] Add textual data to clipboard on copy
The copy action now includes formatted text of the selected entries when
copying, in addition to the supported file and URL types.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-16 07:18:28 -07:00
Christopher Snowhill 4c95c943ef [Playlist Storage] Rewrite to use Core Data
Completely rewrite the playlist storage once again, this time with a
much faster Core Data implementation. It still uses a little magic for
Album Artwork consolidation, but string consolidation doesn't seem to be
needed to reduce the disk storage size. Works much faster than my silly
implementation, too.

Old implementations are still kept for backwards compatibility with
existing playlists.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-16 07:14:33 -07:00
Christopher Snowhill 5bca70d141 [Job Queue] Prevent multiple jobs from stacking
Jobs are meant to be serialized, so prevent multiple jobs from queueing
simultaneously, as they are not designed to interact with each other.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-15 01:10:53 -07:00