Skip to content

Commit 0e4f684

Browse files
author
Alain M
committed
Relesase 0.2.4
1 parent 4a1d54f commit 0e4f684

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

data/com.github.alainm23.byte.appdata.xml.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
<binary>com.github.alainm23.byte</binary>
2424
</provides>
2525
​<releases>
26+
<release version="0.2.4" date="2019-12-30">
27+
<description>
28+
<p>This update brings some new features and bug fixes:</p>
29+
<ul>
30+
<li>Fixing error loading songs in your playlists.</li>
31+
<li>The error that does not allow adding a song as a favorite is fixed.</li>
32+
<li>Notifications now show album covers correctly.</li>
33+
</ul>
34+
</description>
35+
</release>
2636
<release version="0.2.3" date="2019-12-11">
2737
<description>
2838
<p>This update brings some new features and bug fixes:</p>

src/Services/Notification.vala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ public class Services.Notification : GLib.Object {
1717
try {
1818
var notification = new GLib.Notification (track.title);
1919
notification.set_body (track.artist_name);
20-
notification.set_icon (GLib.Icon.new_for_string (Byte.utils.get_cover_file (track.id)));
2120
notification.set_priority (GLib.NotificationPriority.LOW);
22-
21+
22+
if (Byte.utils.cover_file_exists (track.id)) {
23+
notification.set_icon (GLib.Icon.new_for_string (Byte.utils.get_cover_file (track.id)));
24+
} else {
25+
notification.set_icon (new ThemedIcon (Byte.instance.application_id));
26+
}
27+
2328
Byte.instance.send_notification (Byte.instance.application_id, notification);
2429
} catch (Error e) {
2530
stderr.printf ("Error setting default avatar icon: %s ", e.message);

src/Utils.vala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,12 @@ public class Utils : GLib.Object {
244244

245245
public string get_cover_file (int track_id) {
246246
var cover_path = GLib.Path.build_filename (Byte.utils.COVER_FOLDER, ("track-%i.jpg").printf (track_id));
247-
if (File.new_for_path (cover_path).query_exists ()) {
248-
return "file://" + cover_path;
249-
}
247+
return "file://" + cover_path;
248+
}
250249

251-
return "file:///usr/share/com.github.alainm23.byte/track-default-cover.svg";
250+
public bool cover_file_exists (int track_id) {
251+
var cover_path = GLib.Path.build_filename (Byte.utils.COVER_FOLDER, ("track-%i.jpg").printf (track_id));
252+
return File.new_for_path (cover_path).query_exists ();
252253
}
253254

254255
public string get_cover_radio_file (int radio_id) {

src/Views/Playlist.vala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class Views.Playlist : Gtk.EventBox {
4949
var pixbuf = new Gdk.Pixbuf.from_file_at_size (cover_path, 128, 128);
5050
image_cover.pixbuf = pixbuf;
5151
} catch (Error e) {
52-
var pixbuf = new Gdk.Pixbuf.from_file_at_size ("/usr/share/com.github.alainm23.byte/album-default-cover.svg", 128, 128);
52+
var pixbuf = new Gdk.Pixbuf.from_resource_at_scale ("/com/github/alainm23/byte/playlist-default-cover.svg", 128, 128, true);
5353
image_cover.pixbuf = pixbuf;
5454
}
5555

@@ -58,6 +58,7 @@ public class Views.Playlist : Gtk.EventBox {
5858
});
5959

6060
if (Byte.scan_service.is_sync == false) {
61+
print ("Entro aqui\n");
6162
all_tracks = new Gee.ArrayList<Objects.Track?> ();
6263
all_tracks = Byte.database.get_all_tracks_by_playlist (
6364
playlist.id,
@@ -66,6 +67,7 @@ public class Views.Playlist : Gtk.EventBox {
6667
);
6768

6869
foreach (var item in all_tracks) {
70+
print ("ID: %i".printf (item.id));
6971
var row = new Widgets.TrackRow (item, 6);
7072
listbox.add (row);
7173
}

src/Widgets/MediaControl.vala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,7 @@ public class Widgets.MediaControl : Gtk.Revealer {
198198
}
199199

200200
private void activate_menu (Objects.Track track) {
201-
if (menu == null) {
202-
build_context_menu (track);
203-
}
201+
build_context_menu (track);
204202

205203
foreach (var child in playlists.get_children ()) {
206204
child.destroy ();

0 commit comments

Comments
 (0)