Hello community, here is the log from the commit of package gnome-music for openSUSE:Factory checked in at 2020-04-07 10:19:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gnome-music (Old) and /work/SRC/openSUSE:Factory/.gnome-music.new.3248 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gnome-music" Tue Apr 7 10:19:50 2020 rev:50 rq:790687 version:3.34.5 Changes: -------- --- /work/SRC/openSUSE:Factory/gnome-music/gnome-music.changes 2020-02-22 19:01:53.581808335 +0100 +++ /work/SRC/openSUSE:Factory/.gnome-music.new.3248/gnome-music.changes 2020-04-07 10:19:55.085735514 +0200 @@ -1,0 +2,12 @@ +Sat Mar 28 22:04:51 UTC 2020 - Bjørn Lie <bjorn....@gmail.com> + +- Update to version 3.34.5: + + Restore smart playlists updates. + + Various crash and bugfixes. + + Bugs fixed: + - Properly load tracker plugin. + - Stop a deleted playlist if it is playing. + - Fix crash in FlowBox allocations in SearchView. + - Reset count of a smart playlist when all songs are removed. + +------------------------------------------------------------------- Old: ---- gnome-music-3.34.4.tar.xz New: ---- gnome-music-3.34.5.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gnome-music.spec ++++++ --- /var/tmp/diff_new_pack.9U8lpR/_old 2020-04-07 10:19:55.717736217 +0200 +++ /var/tmp/diff_new_pack.9U8lpR/_new 2020-04-07 10:19:55.717736217 +0200 @@ -17,7 +17,7 @@ Name: gnome-music -Version: 3.34.4 +Version: 3.34.5 Release: 0 Summary: Music Player for GNOME License: SUSE-GPL-2.0-with-plugin-exception AND LGPL-2.1-or-later ++++++ gnome-music-3.34.4.tar.xz -> gnome-music-3.34.5.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-music-3.34.4/NEWS new/gnome-music-3.34.5/NEWS --- old/gnome-music-3.34.4/NEWS 2020-02-15 14:33:51.000000000 +0100 +++ new/gnome-music-3.34.5/NEWS 2020-03-28 22:22:52.562239400 +0100 @@ -1,3 +1,21 @@ +Overview of changes in 3.34.5 +============================= + +* Restore smart playlists updates +* Various crash and bugfixes + +Bugs fixed: + Properly load tracker plugin (!652) + Stop a deleted playlist if it is playing (!662) + Fix crash in FlowBox allocations in SearchView (!685) + Reset count of a smart playlist when all songs are removed (!686) + +Thanks to our contributors this release: + Ashwani Singh Tanwar + Jean Felder + Marinus Schraal + Weifeng Lai + Overview of changes in 3.34.4 ============================= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-music-3.34.4/data/org.gnome.Music.appdata.xml.in.in new/gnome-music-3.34.5/data/org.gnome.Music.appdata.xml.in.in --- old/gnome-music-3.34.4/data/org.gnome.Music.appdata.xml.in.in 2020-02-15 14:33:51.000000000 +0100 +++ new/gnome-music-3.34.5/data/org.gnome.Music.appdata.xml.in.in 2020-03-28 22:22:52.562239400 +0100 @@ -28,6 +28,13 @@ </screenshot> </screenshots> <releases> + <release version="3.34.5" date="2020-03-28"> + <description> + <p> + Restore smart playlists update and various bugfixes. + </p> + </description> + </release> <release version="3.34.3" date="2020-02-15"> <description> <p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-music-3.34.4/data/ui/AboutDialog.ui.in new/gnome-music-3.34.5/data/ui/AboutDialog.ui.in --- old/gnome-music-3.34.4/data/ui/AboutDialog.ui.in 2020-02-15 14:33:51.000000000 +0100 +++ new/gnome-music-3.34.5/data/ui/AboutDialog.ui.in 2020-03-28 22:22:52.566239600 +0100 @@ -27,6 +27,7 @@ Andreas Nilsson Apostol Bakalov Arnel A. Borja +Ashwani Singh Tanwar Ashwin Mohan Benoît Legat Bilal Elmoussaoui @@ -92,6 +93,7 @@ Tjipke van der Heide Vadim Rutkovsky Veerasamy Sevagen +Weifeng Lai Yash Singh </property> <property name="artists">Allan Day diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-music-3.34.4/gnomemusic/coregrilo.py new/gnome-music-3.34.5/gnomemusic/coregrilo.py --- old/gnome-music-3.34.4/gnomemusic/coregrilo.py 2020-02-15 14:33:51.000000000 +0100 +++ new/gnome-music-3.34.5/gnomemusic/coregrilo.py 2020-03-28 22:22:52.566239600 +0100 @@ -91,9 +91,10 @@ new_state = self._tracker_wrapper.props.tracker_available # FIXME:No removal support yet. if new_state == TrackerState.AVAILABLE: - # FIXME: Look for a better way to just activate the Tracker - # plugin. - self._registry.load_all_plugins(True) + tracker_plugin = self._registry.lookup_plugin("grl-tracker") + if tracker_plugin: + self._registry.unload_plugin("grl-tracker") + self._registry.activate_plugin_by_id("grl-tracker") def _on_source_added(self, registry, source): @@ -125,18 +126,22 @@ new_state = self._tracker_wrapper.props.tracker_available if (source.props.source_id == "grl-tracker-source" - and source.props.source_id not in self._wrappers.keys() and TrackerWrapper.location_filter() is not None and new_state == TrackerState.AVAILABLE): - new_wrapper = GrlTrackerWrapper( - source, self._coremodel, self._application, self, - self._tracker_wrapper) - self._wrappers[source.props.source_id] = new_wrapper + if source.props.source_id not in self._wrappers.keys(): + new_wrapper = GrlTrackerWrapper( + source, self._coremodel, self._application, self, + self._tracker_wrapper) + self._wrappers[source.props.source_id] = new_wrapper + print("wrapper", new_wrapper) + else: + grl_tracker_wrapper = self._wrappers[source.props.source_id] + registry.unregister_source(grl_tracker_wrapper.props.source) + grl_tracker_wrapper.props.source = source # elif source.props.source_id[:10] == "grl-dleyna": # new_wrapper = GrlDLeynaWrapper( # source, self._coremodel, self._coreselection, self) # self._wrappers.append(new_wrapper) - print("wrapper", new_wrapper) elif (source.props.source_id not in self._search_wrappers.keys() and source.props.source_id not in self._wrappers.keys() and source.get_supported_media() & Grl.MediaType.AUDIO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-music-3.34.4/gnomemusic/coremodel.py new/gnome-music-3.34.5/gnomemusic/coremodel.py --- old/gnome-music-3.34.4/gnomemusic/coremodel.py 2020-02-15 14:33:51.000000000 +0100 +++ new/gnome-music-3.34.5/gnomemusic/coremodel.py 2020-03-28 22:22:52.566239600 +0100 @@ -67,6 +67,7 @@ __gsignals__ = { "artists-loaded": (GObject.SignalFlags.RUN_FIRST, None, ()), "playlist-loaded": (GObject.SignalFlags.RUN_FIRST, None, (int,)), + "smart-playlist-change": (GObject.SignalFlags.RUN_FIRST, None, ()) } active_playlist = GObject.Property(type=Playlist, default=None) @@ -241,10 +242,7 @@ return def _on_items_changed(model, position, removed, added): - if removed > 0: - for i in list(range(removed)): - self._playlist_model.remove(position) - + songs_list = [] if added > 0: for i in list(range(added)): coresong = model[position + i] @@ -252,8 +250,6 @@ coresong.props.media, self._coreselection, self.props.grilo) - self._playlist_model.insert(position + i, song) - song.bind_property( "state", coresong, "state", GObject.BindingFlags.SYNC_CREATE) @@ -262,6 +258,10 @@ GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE) + songs_list.append(song) + + self._playlist_model.splice(position, removed, songs_list) + played_states = [SongWidget.State.PLAYING, SongWidget.State.PLAYED] for song in self._playlist_model: if song.props.state in played_states: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-music-3.34.4/gnomemusic/grilowrappers/grltrackerplaylists.py new/gnome-music-3.34.5/gnomemusic/grilowrappers/grltrackerplaylists.py --- old/gnome-music-3.34.4/gnomemusic/grilowrappers/grltrackerplaylists.py 2020-02-15 14:33:51.000000000 +0100 +++ new/gnome-music-3.34.5/gnomemusic/grilowrappers/grltrackerplaylists.py 2020-03-28 22:22:52.570239500 +0100 @@ -255,6 +255,20 @@ self._tracker.update_blank_async( query, GLib.PRIORITY_LOW, None, _create_cb, None) + def check_smart_playlist_change(self): + """Check if smart playlists need to be updated. + + A smart playlist needs to be updated in two cases: + * it is being played (active_playlist) + * it is visible in PlaylistsView + """ + active_playlist = self._coremodel.props.active_playlist + if (active_playlist is not None + and active_playlist.props.is_smart is True): + active_playlist.update() + else: + self._coremodel.emit("smart-playlist-change") + class Playlist(GObject.GObject): """ Base class of all playlists """ @@ -711,6 +725,52 @@ return self._model + def update(self): + """Updates playlist model.""" + if self._model is None: + return + + new_model_medias = [] + + def _fill_new_model(source, op_id, media, remaining, error): + if error: + return + + if not media: + self._finish_update(new_model_medias) + return + + new_model_medias.append(media) + + options = self._fast_options.copy() + self._source.query( + self.props.query, self.METADATA_KEYS, options, _fill_new_model) + + def _finish_update(self, new_model_medias): + if not new_model_medias: + self._model.remove_all() + self.props.count = 0 + return + + current_models_ids = [coresong.props.media.get_id() + for coresong in self._model] + new_model_ids = [media.get_id() for media in new_model_medias] + + idx_to_delete = [] + for idx, media_id in enumerate(current_models_ids): + if media_id not in new_model_ids: + idx_to_delete.insert(0, idx) + + for idx in idx_to_delete: + self._model.remove(idx) + self.props.count -= 1 + + for idx, media in enumerate(new_model_medias): + if media.get_id() not in current_models_ids: + coresong = CoreSong(media, self._coreselection, self._grilo) + self._model.append(coresong) + self.props.count += 1 + class MostPlayed(SmartPlaylist): """Most Played smart playlist""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-music-3.34.4/gnomemusic/grilowrappers/grltrackerwrapper.py new/gnome-music-3.34.5/gnomemusic/grilowrappers/grltrackerwrapper.py --- old/gnome-music-3.34.4/gnomemusic/grilowrappers/grltrackerwrapper.py 2020-02-15 14:33:51.000000000 +0100 +++ new/gnome-music-3.34.5/gnomemusic/grilowrappers/grltrackerwrapper.py 2020-03-28 22:22:52.570239500 +0100 @@ -79,7 +79,7 @@ self._coremodel = coremodel self._coreselection = application.props.coreselection self._grilo = grilo - self._source = source + self._source = None self._model = self._coremodel.props.songs self._albums_model = self._coremodel.props.albums self._album_ids = {} @@ -101,21 +101,38 @@ self._fast_options.set_resolution_flags( Grl.ResolutionFlags.FAST_ONLY | Grl.ResolutionFlags.IDLE_RELAY) - self._initial_songs_fill(self._source) - self._initial_albums_fill(self._source) - self._initial_artists_fill(self._source) + self._content_changed_id = None + self.props.source = source + + self._initial_songs_fill(self.props.source) + self._initial_albums_fill(self.props.source) + self._initial_artists_fill(self.props.source) self._tracker_playlists = GrlTrackerPlaylists( source, coremodel, application, grilo, tracker_wrapper) - self._source.notify_change_start() - self._source.connect("content-changed", self._batch_content_changed) - - @GObject.Property( - type=Grl.Source, default=None, flags=GObject.ParamFlags.READABLE) + @GObject.Property(type=Grl.Source, default=None) def source(self): return self._source + @source.setter + def source(self, new_source): + """Set a new grilo tracker source + + Everytime, the tracker plugin is loaded, a new source is + created. The source needs to be updated to get notifications. + + :param Grl.Source new_source: new grilo tracker source + """ + if self._content_changed_id is not None: + self._source.disconnect(self._content_changed_id) + self._content_changed_id = None + + self._source = new_source + self._source.notify_change_start() + self._content_changed_id = self._source.connect( + "content-changed", self._batch_content_changed) + def _batch_content_changed(self, source, medias, change_type, loc_unknown): if medias == []: return @@ -147,6 +164,7 @@ self._check_album_change() self._check_artist_change() + self._tracker_playlists.check_smart_playlist_change() self._batch_changed_media_ids = {} self._content_changed_timeout = None @@ -208,7 +226,7 @@ options = self._fast_options.copy() - self._source.query( + self.props.source.query( query, self.METADATA_KEYS, options, check_album_cb) def _check_artist_change(self): @@ -261,7 +279,7 @@ options = self._fast_options.copy() - self._source.query( + self.props.source.query( query, self.METADATA_KEYS, options, check_artist_cb) def _remove_media(self, media_ids): @@ -335,7 +353,7 @@ options = self._fast_options.copy() - self._source.query( + self.props.source.query( self._song_media_query(media_ids), self.METADATA_KEYS, options, _update_changed_media) @@ -386,7 +404,8 @@ } options = self._fast_options.copy() - self._source.query(query, self.METADATA_KEYS, options, _add_to_model) + self.props.source.query( + query, self.METADATA_KEYS, options, _add_to_model) def _initial_albums_fill(self, source): self._window.notifications_popup.push_loading() @@ -531,7 +550,7 @@ return False options = self._fast_options.copy() - self._source.query( + self.props.source.query( query, [Grl.METADATA_KEY_TITLE], options, query_cb) def get_album_discs(self, media, disc_model): @@ -575,7 +594,7 @@ disc_model.append(coredisc) options = self._fast_options.copy() - self._source.query( + self.props.source.query( query, [Grl.METADATA_KEY_ALBUM_DISC_NUMBER], options, _disc_nr_cb) def populate_album_disc_songs(self, media, disc_nr, callback): @@ -622,7 +641,7 @@ } options = self._fast_options.copy() - self._source.query(query, self.METADATA_KEYS, options, callback) + self.props.source.query(query, self.METADATA_KEYS, options, callback) def search(self, text): # FIXME: Searches are limited to not bog down the UI with @@ -688,7 +707,7 @@ artist_filter_ids.append(media.get_id()) options = self._fast_options.copy() - self._source.query( + self.props.source.query( query, self.METADATA_KEYS, options, artist_search_cb) # Album search @@ -743,7 +762,7 @@ album_filter_ids.append(media.get_id()) options = self._fast_options.copy() - self._source.query( + self.props.source.query( query, self.METADATA_KEYS, options, albums_search_cb) # Song search @@ -805,7 +824,8 @@ options = self._fast_options.copy() - self._source.query(query, self.METADATA_KEYS, options, songs_search_cb) + self.props.source.query( + query, self.METADATA_KEYS, options, songs_search_cb) def get_album_art_for_item(self, coresong, callback): """Placeholder until we got a better solution @@ -823,7 +843,7 @@ | Grl.ResolutionFlags.IDLE_RELAY) full_options.set_count(1) - self._source.query( + self.props.source.query( query, self.METADATA_THUMBNAIL_KEYS, full_options, callback) def _get_album_for_album_id(self, album_id): @@ -900,7 +920,7 @@ full_options.set_resolution_flags( Grl.ResolutionFlags.FULL | Grl.ResolutionFlags.IDLE_RELAY) - self._source.resolve( + self.props.source.resolve( media, [Grl.METADATA_KEY_THUMBNAIL], full_options, _resolve_cb, None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-music-3.34.4/gnomemusic/views/playlistsview.py new/gnome-music-3.34.5/gnomemusic/views/playlistsview.py --- old/gnome-music-3.34.4/gnomemusic/views/playlistsview.py 2020-02-15 14:33:51.000000000 +0100 +++ new/gnome-music-3.34.5/gnomemusic/views/playlistsview.py 2020-03-28 22:22:52.570239500 +0100 @@ -115,6 +115,9 @@ self._active_playlist_id = self._coremodel.connect( "notify::active-playlist", self._on_active_playlist_changed) + self._coremodel.connect( + "smart-playlist-change", self._on_smart_playlist_change) + self._model.connect("items-changed", self._on_playlists_model_changed) self._on_playlists_model_changed(self._model, 0, 0, 0) @@ -171,6 +174,13 @@ self._sidebar.select_row(row_next) self._on_playlist_activated(self._sidebar, row_next, True) + def _on_smart_playlist_change(self, coremodel): + selection = self._sidebar.get_selected_row() + current_playlist = selection.props.playlist + if (current_playlist is not None + and current_playlist.props.is_smart): + current_playlist.update() + @log def _on_view_right_clicked(self, gesture, n_press, x, y): requested_row = self._view.get_row_at_y(y) @@ -234,6 +244,8 @@ self._view.bind_model( playlist.props.model, self._create_song_widget, playlist) + if playlist.props.is_smart: + playlist.update() self._pl_ctrls.props.playlist = playlist @@ -340,17 +352,16 @@ selected_row = self._sidebar.get_selected_row() selected_playlist = selected_row.props.playlist + active_playlist = self._coremodel.props.active_playlist + if (active_playlist is not None + and active_playlist == selected_playlist): + self._player.stop() + self._window.set_player_visible(False) + notification = PlaylistNotification( # noqa: F841 self._window.notifications_popup, self._coremodel, PlaylistNotification.Type.PLAYLIST, selected_playlist) - # FIXME: Should Check that the playlist is not playing - # playlist_id = selection.playlist.props.pl_id - # if self._player.playing_playlist( - # PlayerPlaylist.Type.PLAYLIST, playlist_id): - # self._player.stop() - # self._window.set_player_visible(False) - def _on_song_widget_moved(self, target, source_position): target_position = target.get_parent().get_index() selection = self._sidebar.get_selected_row() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-music-3.34.4/gnomemusic/views/searchview.py new/gnome-music-3.34.5/gnomemusic/views/searchview.py --- old/gnome-music-3.34.4/gnomemusic/views/searchview.py 2020-02-15 14:33:51.000000000 +0100 +++ new/gnome-music-3.34.5/gnomemusic/views/searchview.py 2020-03-28 22:22:52.570239500 +0100 @@ -206,6 +206,11 @@ nr_albums = self._album_model.get_n_items() self._view_all_albums.props.visible = (nr_albums > model.get_n_items()) + def set_child_visible(child): + child.props.visible = True + + self._album_flowbox.foreach(set_child_visible) + def _on_artist_model_items_changed(self, model, position, removed, added): items_found = model.get_n_items() > 0 self._artist_header.props.visible = items_found @@ -216,6 +221,11 @@ self._view_all_artists.props.visible = ( nr_artists > model.get_n_items()) + def set_child_visible(child): + child.props.visible = True + + self._artist_flowbox.foreach(set_child_visible) + def _on_model_items_changed(self, model, position, removed, added): items_found = model.get_n_items() > 0 self._songs_header.props.visible = items_found diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-music-3.34.4/meson.build new/gnome-music-3.34.5/meson.build --- old/gnome-music-3.34.4/meson.build 2020-02-15 14:33:51.000000000 +0100 +++ new/gnome-music-3.34.5/meson.build 2020-03-28 22:22:52.574239700 +0100 @@ -1,5 +1,5 @@ project('gnome-music', - version: '3.34.4', + version: '3.34.5', meson_version: '>= 0.46.0' )