After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702377 - Add support for notifications
Add support for notifications
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: 3.12
Assigned To: Giovanni Campagna
gnome-music-maint
: 708065 (view as bug list)
Depends on: 702390
Blocks:
 
 
Reported: 2013-06-16 00:50 UTC by Giovanni Campagna
Modified: 2013-09-15 02:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
AlbumArtCache: cleanup the public interface and correct the filenames (11.58 KB, patch)
2013-06-16 00:50 UTC, Giovanni Campagna
committed Details | Review
Player: make it observable from the outside (2.75 KB, patch)
2013-06-16 00:50 UTC, Giovanni Campagna
committed Details | Review
Add support for notifications (8.80 KB, patch)
2013-06-16 00:50 UTC, Giovanni Campagna
needs-work Details | Review
Add support for notifications (8.79 KB, patch)
2013-06-18 14:40 UTC, Giovanni Campagna
needs-work Details | Review
Player: make it observable from the outside (2.75 KB, patch)
2013-06-21 13:35 UTC, Vadim Rutkovsky
committed Details | Review
AlbumArtCache: cleanup the public interface and correct the filenames (11.58 KB, patch)
2013-06-21 13:35 UTC, Vadim Rutkovsky
committed Details | Review
AlbumArtCache: don't drop requests on the floor on failure (4.55 KB, patch)
2013-07-04 14:25 UTC, Giovanni Campagna
rejected Details | Review
Add support for notifications (9.31 KB, patch)
2013-09-01 14:21 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2013-06-16 00:50:07 UTC
Much like rhythmbox does, using all the fancy gnome-shell stuff.
Comment 1 Giovanni Campagna 2013-06-16 00:50:10 UTC
Created attachment 246916 [details] [review]
AlbumArtCache: cleanup the public interface and correct the filenames

Almost always, the user of AlbumArtCache wants to lookup the image
in cache or trigger a resolve operation and fetch from the network.
Also, sometimes the API user is interested in the cached path too
(for example to send to another app).
Naturally, for that to work we need to ensure that PNG thumbnails
end up with .png, not .jpeg. For us it works because we use
gdk_pixbuf_new_from_stream(), which uses sniffing exclusively.
Comment 2 Giovanni Campagna 2013-06-16 00:50:17 UTC
Created attachment 246917 [details] [review]
Player: make it observable from the outside

Add a public "playing" property, which wraps the Gst state in
a high livel boolean, and add signals to monitor playing state
and current track.
Comment 3 Giovanni Campagna 2013-06-16 00:50:22 UTC
Created attachment 246918 [details] [review]
Add support for notifications

Add a NotificationManager object that watches the Player and
keeps a resident notification to control the application.
Comment 4 Vadim Rutkovsky 2013-06-18 11:16:26 UTC
Cannot apply the third patch:
Applying: Add support for notifications
fatal: sha1 information is lacking or useless (src/application.js).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Add support for notifications

Please rebase on the latest master
Comment 5 Vadim Rutkovsky 2013-06-18 11:26:15 UTC
Review of attachment 246918 [details] [review]:

Prints non-critical error (on gnome 3.8 at least)

(gnome-music:18678): Gjs-WARNING **: JS ERROR: Exception in callback for signal: playing-changed: Error: Too few arguments to method Notify.add_action expected 4 got 3
NotificationManager<._setActions@/opt/gnome/share/gnome-music/notifications.js:124
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
NotificationManager<._init/<@/opt/gnome/share/gnome-music/notifications.js:51
_emit@/opt/gnome/share/gjs-1.0/signals.js:124
Player<._init/<@/opt/gnome/share/gnome-music/player.js:75
main@/opt/gnome/share/gnome-music/main.js:29
start@/opt/gnome/share/gnome-music/package.js:154
@/opt/gnome/bin/gnome-music:3
Comment 6 Giovanni Campagna 2013-06-18 14:39:29 UTC
I forgot to mention this depends on libnotify bug 702390.
Comment 7 Giovanni Campagna 2013-06-18 14:40:01 UTC
Created attachment 247159 [details] [review]
Add support for notifications

Add a NotificationManager object that watches the Player and
keeps a resident notification to control the application.
Comment 8 Vadim Rutkovsky 2013-06-18 15:34:27 UTC
Thanks, looks good, waiting for bug 702390 to be resolved to commit this.
Comment 9 Vadim Rutkovsky 2013-06-21 13:35:18 UTC
The following fixes have been pushed:
de7293a Player: make it observable from the outside
2c93196 AlbumArtCache: cleanup the public interface and correct the filenames
Comment 10 Vadim Rutkovsky 2013-06-21 13:35:29 UTC
Created attachment 247439 [details] [review]
Player: make it observable from the outside

Add a public "playing" property, which wraps the Gst state in
a high livel boolean, and add signals to monitor playing state
and current track.
Comment 11 Vadim Rutkovsky 2013-06-21 13:35:33 UTC
Created attachment 247440 [details] [review]
AlbumArtCache: cleanup the public interface and correct the filenames

Almost always, the user of AlbumArtCache wants to lookup the image
in cache or trigger a resolve operation and fetch from the network.
Also, sometimes the API user is interested in the cached path too
(for example to send to another app).
Naturally, for that to work we need to ensure that PNG thumbnails
end up with .png, not .jpeg. For us it works because we use
gdk_pixbuf_new_from_stream(), which uses sniffing exclusively.
Comment 12 Giovanni Campagna 2013-07-04 14:25:07 UTC
Created attachment 248391 [details] [review]
AlbumArtCache: don't drop requests on the floor on failure

Previously, we would not call the callback unless the album art
was successfully retrieved, but that would leave callers waiting
forever on failure.
Instead, invoke the callback with a null pixbuf.

I had this as an amend to the previous AAC patch. It's needed
by the notification manager, which otherwise shows nothing for
albums without art.
Comment 13 Arnel Borja 2013-08-22 16:41:45 UTC
These patches need to be ported to python.
Comment 14 Arnel Borja 2013-08-31 11:44:58 UTC
Comment on attachment 247159 [details] [review]
Add support for notifications

Port to Python is needed.
Comment 15 Arnel Borja 2013-08-31 11:45:33 UTC
Comment on attachment 248391 [details] [review]
AlbumArtCache: don't drop requests on the floor on failure

This is already implemented in current master.
Comment 16 Giovanni Campagna 2013-09-01 14:21:30 UTC
Created attachment 253755 [details] [review]
Add support for notifications

Add a NotificationManager object that watches the Player and
keeps a resident notification to control the application.
Comment 17 Yosef Or Boczko 2013-09-03 16:07:51 UTC
(In reply to comment #16)
> Created an attachment (id=253755) [details] [review]
> Add support for notifications
> 
> Add a NotificationManager object that watches the Player and
> keeps a resident notification to control the application.

Need to use rtl variants of icons when using RTL languages, for example:
https://git.gnome.org/browse/rhythmbox/commit/?id=eb4641a127828a0fa567eb19c26c66ff7f3b2f52
and 
https://git.gnome.org/browse/gnome-music/commit/?id=cf8c8c80ce400220b23f932198340fa3f1e6e307
Comment 18 Arnel Borja 2013-09-08 04:21:06 UTC
Review of attachment 253755 [details] [review]:

I tested this patch and seems alright. Vadim accepted it for commit. But because of the UI and String Freeze, this is on hold and is currently residing in a branch in out GitHub mirror at: https://github.com/gnome-prototypes-team/gnome-music/commits/notifications

Fixes for RTL is still not there, but we will ensure that this issue will be fixed before merging.

It will merged along with some fixes after the release team approves the following UI Freeze Break: https://mail.gnome.org/archives/release-team/2013-September/msg00028.html

The String Freeze Break is already accepted by Piotr Drąg and Petr Kovar.
Comment 19 Arnel Borja 2013-09-12 15:45:48 UTC
Comment on attachment 253755 [details] [review]
Add support for notifications

Committed as a4c8649ce. RTL will be fixed later. Accepted for UI freeze break in https://mail.gnome.org/archives/release-team/2013-September/msg00088.html
Comment 20 Arnel Borja 2013-09-12 15:46:37 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report (and patches :D).
Comment 21 Arnel Borja 2013-09-15 02:28:55 UTC
*** Bug 708065 has been marked as a duplicate of this bug. ***