Skip to content

Commit

Permalink
Relesase 0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Alain M committed Dec 31, 2019
1 parent 4a1d54f commit 0e4f684
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
10 changes: 10 additions & 0 deletions data/com.github.alainm23.byte.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
<binary>com.github.alainm23.byte</binary>
</provides>
​<releases>
<release version="0.2.4" date="2019-12-30">
<description>
<p>This update brings some new features and bug fixes:</p>
<ul>
<li>Fixing error loading songs in your playlists.</li>
<li>The error that does not allow adding a song as a favorite is fixed.</li>
<li>Notifications now show album covers correctly.</li>
</ul>
</description>
</release>
<release version="0.2.3" date="2019-12-11">
<description>
<p>This update brings some new features and bug fixes:</p>
Expand Down
9 changes: 7 additions & 2 deletions src/Services/Notification.vala
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ public class Services.Notification : GLib.Object {
try {
var notification = new GLib.Notification (track.title);
notification.set_body (track.artist_name);
notification.set_icon (GLib.Icon.new_for_string (Byte.utils.get_cover_file (track.id)));
notification.set_priority (GLib.NotificationPriority.LOW);


if (Byte.utils.cover_file_exists (track.id)) {
notification.set_icon (GLib.Icon.new_for_string (Byte.utils.get_cover_file (track.id)));
} else {
notification.set_icon (new ThemedIcon (Byte.instance.application_id));
}

Byte.instance.send_notification (Byte.instance.application_id, notification);
} catch (Error e) {
stderr.printf ("Error setting default avatar icon: %s ", e.message);
Expand Down
9 changes: 5 additions & 4 deletions src/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,12 @@ public class Utils : GLib.Object {

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

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

public string get_cover_radio_file (int radio_id) {
Expand Down
4 changes: 3 additions & 1 deletion src/Views/Playlist.vala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class Views.Playlist : Gtk.EventBox {
var pixbuf = new Gdk.Pixbuf.from_file_at_size (cover_path, 128, 128);
image_cover.pixbuf = pixbuf;
} catch (Error e) {
var pixbuf = new Gdk.Pixbuf.from_file_at_size ("/usr/share/com.github.alainm23.byte/album-default-cover.svg", 128, 128);
var pixbuf = new Gdk.Pixbuf.from_resource_at_scale ("/com/github/alainm23/byte/playlist-default-cover.svg", 128, 128, true);
image_cover.pixbuf = pixbuf;
}

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

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

foreach (var item in all_tracks) {
print ("ID: %i".printf (item.id));
var row = new Widgets.TrackRow (item, 6);
listbox.add (row);
}
Expand Down
4 changes: 1 addition & 3 deletions src/Widgets/MediaControl.vala
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ public class Widgets.MediaControl : Gtk.Revealer {
}

private void activate_menu (Objects.Track track) {
if (menu == null) {
build_context_menu (track);
}
build_context_menu (track);

foreach (var child in playlists.get_children ()) {
child.destroy ();
Expand Down

0 comments on commit 0e4f684

Please sign in to comment.