Commit Graph

16 Commits (4bed0af868a76a3d82301a1733c6e0574dd9d0d4)

Author SHA1 Message Date
Christopher Snowhill 4bed0af868 Core Data Store: Handle concurrency properly
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>
2022-10-30 16:54:52 -07:00
Christopher Snowhill c9181f571f Better locking behavior for playlist storage
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>
2022-10-11 23:09:05 -07:00
Christopher Snowhill 77b3d74948 [Sandbox Paths] Automatically clean up old paths
Clean up redundant paths automatically, and on startup. Also refresh the
preferences dialog path list every time it is opened.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-24 23:14:52 -07:00
Christopher Snowhill 92b02c20db [Sandbox Dialog] Fix removing newly added paths
Newly added paths weren't adding all of the necessary data to the list
storage to make it possible to remove them without restarting the
player. Oops.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-24 19:17:04 -07:00
Christopher Snowhill 47258b02b1 [Core Data] Add access locking
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>
2022-07-15 07:00:11 -07:00
Christopher Snowhill 60964a00b2 [Path Config] Remove exact items by token id
Should use the exact token object to remove them, rather than doing a
path comparison.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-06 00:04:45 -07:00
Christopher Snowhill d03fb11f4c [Path Config] Properly prune the database
When cleaning up the path list, actually remove the pruned entries from
the Core Data storage, so they don't end up resolving to broken
bookmarks in the player, breaking playback on migrated configurations.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-05 23:47:05 -07:00
Christopher Snowhill 0e2bfeb671 [Path Config] Properly report broken bookmarks
Broken bookmarks weren't reporting as isStale, but rather, were failing
to resolve at all, and without this change, they were impossible to
detect in a migrated configuration.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-05 23:45:46 -07:00
Christopher Snowhill 7e2dda750e [Sandbox Config] Correctly test paths for files
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-29 12:11:22 -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 cc46c5a5ee [Sandbox Configuration] Do more checks on test
When testing the path for whether it's in storage, run more tests to
make sure we only care about valid paths, and a path that actually has
a string.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-21 16:16:47 -07:00
Christopher Snowhill 3d8f470206 [Sandbox Configuration] Delete from storage later
Only delete from storage after deleting it from the UI list.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-21 16:15:50 -07:00
Christopher Snowhill 51f8536943 [Sandbox Configuration] Do not delete path on fail
Do not delete path from storage when save fails.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-21 16:14:45 -07:00
Christopher Snowhill e8dacdabda [Sandbox] Add Playlist Path Suggester
Add a dialog for suggesting sandbox paths to the Preferences general
page, in the context menu.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-21 02:45:45 -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 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