Show album art with UserNotification api. #61
No reviewers
Labels
No labels
2230
2243
App version
Apple OS errata
Apple SDK
bug
bugsnag
build
dlt
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: chris/Cog#61
Loading…
Reference in a new issue
No description provided.
Delete branch "nevack/notifications"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Also hide no-op iTunes Style option.
Quick question regarding this: Will there be a race condition for the temp file? Does it really need to be a file and not a memory object? I can apply this if you're sure it's ready.
I don't know a way to make URL to NSData.
Used this tutorial https://nshipster.com/temporary-files/#creating-a-temporary-file
@kode54 Can you suggest a better way to do this?
We need to supply URL to local file as per UNNotificationAttachment documentation.
@ -409,3 +409,4 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Enable notifications" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="hqT-nY-NoU">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
PS. I think it's better to save Album art in Cog's Cache folder instead of storing bytes in xml.
You're welcome to help make that possible, too. I'm thinking maybe hash filenames, similar to what I'm already using for the reference keys in the xml. Meh, I probably should have done this in the first place.
I'm also looking to some day make the whole thing sandbox-able. The whole main barrier is keeping a minimal amount of NSBookmark handles around in the saved data so permission to all the local tracks in the playlist persists. Perhaps permission to the entire local files' folders, too, since I also had some person ask if I could make it possible to scan for and add entire albums from folders just from adding one or more tracks. That sounds a mite complicated, though.
Nope. And I can't suggest using a unique name, either, because then it's on us to wipe out the old files when placing a new file. Maybe using a specific temp file name pattern, and wiping them all on startup, exit, and before placing a new file, but still using a unique name, so that old requests pull the missing file, while new are guaranteed to always get the newly generated file. Or something.
@ -409,3 +409,4 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Enable notifications" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="hqT-nY-NoU">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
Also, I'm open to suggestions to replace the icon and category. It should be a "notifications" category or perhaps "toasts" or something, and it needs an appropriate icon.
Oh, it already produces a unique name. Huh, sorry I didn't notice that sooner.
I'll update preference pane icons to SF Symbols for macOS 11.0+ and rename Growl to Notifications in next PR
Okay, looks good.