Hello community, here is the log from the commit of package lollypop for openSUSE:Factory checked in at 2020-10-26 16:20:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lollypop (Old) and /work/SRC/openSUSE:Factory/.lollypop.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lollypop" Mon Oct 26 16:20:41 2020 rev:139 rq:843878 version:1.4.5 Changes: -------- --- /work/SRC/openSUSE:Factory/lollypop/lollypop.changes 2020-10-24 15:19:08.468329852 +0200 +++ /work/SRC/openSUSE:Factory/.lollypop.new.3463/lollypop.changes 2020-10-26 16:21:47.959199879 +0100 @@ -1,0 +2,7 @@ +Sun Oct 25 09:39:14 UTC 2020 - antoine.belv...@opensuse.org + +- Update to version 1.4.5: + * Fix an issue with command line handler + (glgo#World/lollypop#2590). + +------------------------------------------------------------------- Old: ---- lollypop-1.4.4.tar.xz New: ---- lollypop-1.4.5.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lollypop.spec ++++++ --- /var/tmp/diff_new_pack.GG3kXz/_old 2020-10-26 16:21:49.371201015 +0100 +++ /var/tmp/diff_new_pack.GG3kXz/_new 2020-10-26 16:21:49.371201015 +0100 @@ -17,7 +17,7 @@ Name: lollypop -Version: 1.4.4 +Version: 1.4.5 Release: 0 Summary: GNOME music playing application License: GPL-3.0-or-later ++++++ _service ++++++ --- /var/tmp/diff_new_pack.GG3kXz/_old 2020-10-26 16:21:49.403201041 +0100 +++ /var/tmp/diff_new_pack.GG3kXz/_new 2020-10-26 16:21:49.403201041 +0100 @@ -1,7 +1,7 @@ <services> <service mode="disabled" name="tar_scm"> <param name="changesgenerate">enable</param> - <param name="revision">1.4.4</param> + <param name="revision">1.4.5</param> <param name="scm">git</param> <param name="url">https://gitlab.gnome.org/World/lollypop.git</param> <param name="versionformat">@PARENT_TAG@</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.GG3kXz/_old 2020-10-26 16:21:49.419201054 +0100 +++ /var/tmp/diff_new_pack.GG3kXz/_new 2020-10-26 16:21:49.423201057 +0100 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">https://gitlab.gnome.org/World/lollypop.git</param> - <param name="changesrevision">91d0384e4547b21e48e7f36d5bcdd0c8d933d5ad</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">3b129c5986af15fc110009a957629c19fab8c09e</param></service></servicedata> \ No newline at end of file ++++++ lollypop-1.4.4.tar.xz -> lollypop-1.4.5.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lollypop-1.4.4/bin/revision.sh new/lollypop-1.4.5/bin/revision.sh --- old/lollypop-1.4.4/bin/revision.sh 2020-10-23 22:36:20.000000000 +0200 +++ new/lollypop-1.4.5/bin/revision.sh 2020-10-24 21:46:21.000000000 +0200 @@ -1,8 +1,2 @@ #!/bin/sh -VERSION="@VERSION@" -if [[ $VERSION != "@VERSION@" ]] -then - echo $VERSION -else - git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' -fi +git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lollypop-1.4.4/data/org.gnome.Lollypop.appdata.xml.in new/lollypop-1.4.5/data/org.gnome.Lollypop.appdata.xml.in --- old/lollypop-1.4.4/data/org.gnome.Lollypop.appdata.xml.in 2020-10-23 22:36:20.000000000 +0200 +++ new/lollypop-1.4.5/data/org.gnome.Lollypop.appdata.xml.in 2020-10-24 21:46:21.000000000 +0200 @@ -17,7 +17,7 @@ </ul> </description> <releases> - <release version="1.4.4" date="2020-10-23"> + <release version="1.4.5" date="2020-10-24"> <description> </description> </release> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lollypop-1.4.4/lollypop/application.py new/lollypop-1.4.5/lollypop/application.py --- old/lollypop-1.4.4/lollypop/application.py 2020-10-23 22:36:20.000000000 +0200 +++ new/lollypop-1.4.5/lollypop/application.py 2020-10-24 21:46:21.000000000 +0200 @@ -24,12 +24,12 @@ from threading import current_thread from pickle import dump from signal import signal, SIGINT, SIGTERM -from urllib.parse import urlparse -from lollypop.utils import init_proxy_from_gnome, emit_signal +from lollypop.utils import init_proxy_from_gnome from lollypop.application_actions import ApplicationActions -from lollypop.utils_file import get_file_type, install_youtube_dl -from lollypop.define import LOLLYPOP_DATA_PATH, ScanType, StorageType, FileType +from lollypop.application_cmdline import ApplicationCmdline +from lollypop.utils_file import install_youtube_dl +from lollypop.define import LOLLYPOP_DATA_PATH, StorageType from lollypop.database import Database from lollypop.player import Player from lollypop.inhibitor import Inhibitor @@ -45,14 +45,12 @@ from lollypop.database_tracks import TracksDatabase from lollypop.notification import NotificationManager from lollypop.playlists import Playlists -from lollypop.objects_track import Track -from lollypop.objects_album import Album from lollypop.helper_task import TaskHelper from lollypop.helper_art import ArtHelper from lollypop.collection_scanner import CollectionScanner -class Application(Gtk.Application, ApplicationActions): +class Application(Gtk.Application, ApplicationActions, ApplicationCmdline): """ Lollypop application: - Handle appmenu @@ -70,7 +68,7 @@ self, application_id="org.gnome.Lollypop", flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE) - self.__version = version + ApplicationCmdline.__init__(self, version) self.__data_dir = data_dir self.set_property("register-session", True) signal(SIGINT, lambda a, b: self.quit()) @@ -94,7 +92,6 @@ GLib.setenv("SSL_CERT_FILE", path, True) break self.cursors = {} - self.debug = False self.shown_sidebar_tooltip = False self.__window = None self.__fs_window = None @@ -102,40 +99,8 @@ self.animations = settings.get_value("enable-animations").get_boolean() GLib.set_application_name("Lollypop") GLib.set_prgname("lollypop") - self.add_main_option("play-ids", b"a", GLib.OptionFlags.NONE, - GLib.OptionArg.STRING, "Play ids", None) - self.add_main_option("debug", b"d", GLib.OptionFlags.NONE, - GLib.OptionArg.NONE, "Debug Lollypop", None) - self.add_main_option("set-rating", b"r", GLib.OptionFlags.NONE, - GLib.OptionArg.STRING, "Rate the current track", - None) - self.add_main_option("play-pause", b"t", GLib.OptionFlags.NONE, - GLib.OptionArg.NONE, "Toggle playback", - None) - self.add_main_option("stop", b"s", GLib.OptionFlags.NONE, - GLib.OptionArg.NONE, "Stop playback", - None) - self.add_main_option("next", b"n", GLib.OptionFlags.NONE, - GLib.OptionArg.NONE, "Go to next track", - None) - self.add_main_option("prev", b"p", GLib.OptionFlags.NONE, - GLib.OptionArg.NONE, "Go to prev track", - None) - self.add_main_option("emulate-phone", b"e", GLib.OptionFlags.NONE, - GLib.OptionArg.NONE, - "Emulate a Librem phone", - None) - self.add_main_option("version", b"v", GLib.OptionFlags.NONE, - GLib.OptionArg.NONE, - "Lollypop version", - None) - self.connect("command-line", self.__on_command_line) - self.connect("handle-local-options", self.__on_handle_local_options) self.connect("activate", self.__on_activate) self.connect("shutdown", lambda a: self.__save_state()) - self.register(None) - if self.get_is_remote(): - Gdk.notify_startup_complete() if GLib.environ_getenv(GLib.get_environ(), "DEBUG_LEAK") is not None: import gc gc.set_debug(gc.DEBUG_LEAK) @@ -331,14 +296,6 @@ """ return self.__gtk_dark - @property - def version(self): - """ - Get Lollypop version - @return srt - """ - return self.__version - ####################### # PRIVATE # ####################### @@ -400,140 +357,6 @@ except Exception as e: Logger.error("Application::__vacuum(): %s" % e) - def __parse_uris(self, playlist_uris, audio_uris): - """ - Parse playlist uris - @param playlist_uris as [str] - @param audio_uris as [str] - """ - from gi.repository import TotemPlParser - playlist_uri = playlist_uris.pop(0) - parser = TotemPlParser.Parser.new() - parser.connect("entry-parsed", - self.__on_entry_parsed, - audio_uris) - parser.parse_async(playlist_uri, True, None, - self.__on_parse_finished, - playlist_uris, audio_uris) - - def __on_handle_local_options(self, app, options): - """ - Handle local options - @param app as Gio.Application - @param options as GLib.VariantDict - """ - if options.contains("version"): - print("Lollypop %s" % self.__version) - exit(0) - return -1 - - def __on_command_line(self, app, app_cmd_line): - """ - Handle command line - @param app as Gio.Application - @param options as Gio.ApplicationCommandLine - """ - try: - args = app_cmd_line.get_arguments() - options = app_cmd_line.get_options_dict() - if options.contains("debug"): - self.debug = True - if options.contains("set-rating"): - value = options.lookup_value("set-rating").get_string() - try: - value = min(max(0, int(value)), 5) - if self.player.current_track.id is not None: - self.player.current_track.set_rate(value) - except Exception as e: - Logger.error("Application::__on_command_line(): %s", e) - pass - elif options.contains("play-pause"): - self.player.play_pause() - elif options.contains("stop"): - self.player.stop() - elif options.contains("play-ids"): - try: - value = options.lookup_value("play-ids").get_string() - ids = value.split(";") - albums = [] - for id in ids: - if id[0:2] == "a:": - album = Album(int(id[2:])) - self.player.add_album(album) - albums.append(album) - else: - track = Track(int(id[2:])) - self.player.add_album(track.album) - albums.append(track.album) - if albums and albums[0].tracks: - self.player.load(albums[0].tracks[0]) - except Exception as e: - Logger.error("Application::__on_command_line(): %s", e) - pass - elif options.contains("next"): - self.player.next() - elif options.contains("prev"): - self.player.prev() - elif options.contains("emulate-phone"): - self.__window.toolbar.end.devices_popover.add_fake_phone() - elif len(args) > 1: - audio_uris = [] - playlist_uris = [] - for uri in args[1:]: - parsed = urlparse(uri) - if parsed.scheme not in ["http", "https"]: - try: - uri = GLib.filename_to_uri(uri) - except: - pass - f = Gio.File.new_for_uri(uri) - # Try ./filename - if not f.query_exists(): - uri = GLib.filename_to_uri( - "%s/%s" % (GLib.get_current_dir(), uri)) - print(uri) - f = Gio.File.new_for_uri(uri) - file_type = get_file_type(uri) - if file_type == FileType.PLS: - playlist_uris.append(uri) - else: - audio_uris.append(uri) - if playlist_uris: - self.__parse_uris(playlist_uris, audio_uris) - else: - self.__on_parse_finished(None, None, [], audio_uris) - elif self.__window is not None: - if not self.__window.is_visible(): - self.__window.present() - emit_signal(self.player, "status-changed") - emit_signal(self.player, "current-changed") - Gdk.notify_startup_complete() - except Exception as e: - Logger.error("Application::__on_command_line(): %s", e) - return 0 - - def __on_parse_finished(self, source, result, playlist_uris, audio_uris): - """ - Play stream - @param source as None - @param result as Gio.AsyncResult - @param uris as ([str], [str]) - """ - if playlist_uris: - self.__parse_uris(playlist_uris, audio_uris) - else: - self.scanner.update(ScanType.EXTERNAL, audio_uris) - - def __on_entry_parsed(self, parser, uri, metadata, audio_uris): - """ - Add playlist entry to external files - @param parser as TotemPlParser.Parser - @param uri as str - @param metadata as GLib.HastTable - @param audio_uris as str - """ - audio_uris.append(uri) - def __hide_on_delete(self, widget, event): """ Hide window diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lollypop-1.4.4/lollypop/application_cmdline.py new/lollypop-1.4.5/lollypop/application_cmdline.py --- old/lollypop-1.4.4/lollypop/application_cmdline.py 1970-01-01 01:00:00.000000000 +0100 +++ new/lollypop-1.4.5/lollypop/application_cmdline.py 2020-10-24 21:46:21.000000000 +0200 @@ -0,0 +1,222 @@ +# Copyright (c) 2014-2020 Cedric Bellegarde <cedric.bellega...@adishatz.org> +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +from gi.repository import Gio, GLib, Gdk + +from urllib.parse import urlparse + +from lollypop.utils import emit_signal +from lollypop.utils_file import get_file_type +from lollypop.define import ScanType, FileType +from lollypop.logger import Logger +from lollypop.objects_track import Track +from lollypop.objects_album import Album + + +class ApplicationCmdline: + """ + Handle command line switches + Need to be inherited by a Gtk.Application + """ + + def __init__(self, version): + """ + Create cmdline handler + @param version as str + """ + self.__debug = False + self.__version = version + self.add_main_option("play-ids", b"a", GLib.OptionFlags.NONE, + GLib.OptionArg.STRING, "Play ids", None) + self.add_main_option("debug", b"d", GLib.OptionFlags.NONE, + GLib.OptionArg.NONE, "Debug Lollypop", None) + self.add_main_option("set-rating", b"r", GLib.OptionFlags.NONE, + GLib.OptionArg.STRING, "Rate the current track", + None) + self.add_main_option("play-pause", b"t", GLib.OptionFlags.NONE, + GLib.OptionArg.NONE, "Toggle playback", + None) + self.add_main_option("stop", b"s", GLib.OptionFlags.NONE, + GLib.OptionArg.NONE, "Stop playback", + None) + self.add_main_option("next", b"n", GLib.OptionFlags.NONE, + GLib.OptionArg.NONE, "Go to next track", + None) + self.add_main_option("prev", b"p", GLib.OptionFlags.NONE, + GLib.OptionArg.NONE, "Go to prev track", + None) + self.add_main_option("emulate-phone", b"e", GLib.OptionFlags.NONE, + GLib.OptionArg.NONE, + "Emulate a Librem phone", + None) + self.add_main_option("version", b"v", GLib.OptionFlags.NONE, + GLib.OptionArg.NONE, + "Lollypop version", + None) + self.connect("command-line", self.__on_command_line) + self.connect("handle-local-options", self.__on_handle_local_options) + + @property + def version(self): + """ + Get Lollypop version + @return srt + """ + return self.__version + + @property + def debug(self): + """ + Get debug state + @return bool + """ + return self.__debug + +####################### +# PRIVATE # +####################### + def __parse_uris(self, playlist_uris, audio_uris): + """ + Parse playlist uris + @param playlist_uris as [str] + @param audio_uris as [str] + """ + from gi.repository import TotemPlParser + playlist_uri = playlist_uris.pop(0) + parser = TotemPlParser.Parser.new() + parser.connect("entry-parsed", + self.__on_entry_parsed, + audio_uris) + parser.parse_async(playlist_uri, True, None, + self.__on_parse_finished, + playlist_uris, audio_uris) + + def __on_handle_local_options(self, app, options): + """ + Handle local options + @param app as Gio.Application + @param options as GLib.VariantDict + """ + if options.contains("version"): + print(self.__version) + exit(0) + self.register(None) + if self.get_is_remote(): + Gdk.notify_startup_complete() + return -1 + + def __on_command_line(self, app, app_cmd_line): + """ + Handle command line + @param app as Gio.Application + @param options as Gio.ApplicationCommandLine + """ + try: + args = app_cmd_line.get_arguments() + options = app_cmd_line.get_options_dict() + if options.contains("debug"): + self.__debug = True + if options.contains("set-rating"): + value = options.lookup_value("set-rating").get_string() + try: + value = min(max(0, int(value)), 5) + if self.player.current_track.id is not None: + self.player.current_track.set_rate(value) + except Exception as e: + Logger.error("Application::__on_command_line(): %s", e) + pass + elif options.contains("play-pause"): + self.player.play_pause() + elif options.contains("stop"): + self.player.stop() + elif options.contains("play-ids"): + try: + value = options.lookup_value("play-ids").get_string() + ids = value.split(";") + albums = [] + for id in ids: + if id[0:2] == "a:": + album = Album(int(id[2:])) + self.player.add_album(album) + albums.append(album) + else: + track = Track(int(id[2:])) + self.player.add_album(track.album) + albums.append(track.album) + if albums and albums[0].tracks: + self.player.load(albums[0].tracks[0]) + except Exception as e: + Logger.error("Application::__on_command_line(): %s", e) + pass + elif options.contains("next"): + self.player.next() + elif options.contains("prev"): + self.player.prev() + elif options.contains("emulate-phone"): + self.window.toolbar.end.devices_popover.add_fake_phone() + elif len(args) > 1: + audio_uris = [] + playlist_uris = [] + for uri in args[1:]: + parsed = urlparse(uri) + if parsed.scheme not in ["http", "https"]: + try: + uri = GLib.filename_to_uri(uri) + except: + pass + f = Gio.File.new_for_uri(uri) + # Try ./filename + if not f.query_exists(): + uri = GLib.filename_to_uri( + "%s/%s" % (GLib.get_current_dir(), uri)) + print(uri) + f = Gio.File.new_for_uri(uri) + file_type = get_file_type(uri) + if file_type == FileType.PLS: + playlist_uris.append(uri) + else: + audio_uris.append(uri) + if playlist_uris: + self.__parse_uris(playlist_uris, audio_uris) + else: + self.__on_parse_finished(None, None, [], audio_uris) + elif self.window is not None: + if not self.window.is_visible(): + self.window.present() + emit_signal(self.player, "status-changed") + emit_signal(self.player, "current-changed") + Gdk.notify_startup_complete() + except Exception as e: + Logger.error("Application::__on_command_line(): %s", e) + return 0 + + def __on_parse_finished(self, source, result, playlist_uris, audio_uris): + """ + Play stream + @param source as None + @param result as Gio.AsyncResult + @param uris as ([str], [str]) + """ + if playlist_uris: + self.__parse_uris(playlist_uris, audio_uris) + else: + self.scanner.update(ScanType.EXTERNAL, audio_uris) + + def __on_entry_parsed(self, parser, uri, metadata, audio_uris): + """ + Add playlist entry to external files + @param parser as TotemPlParser.Parser + @param uri as str + @param metadata as GLib.HastTable + @param audio_uris as str + """ + audio_uris.append(uri) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lollypop-1.4.4/lollypop/collection_scanner.py new/lollypop-1.4.5/lollypop/collection_scanner.py --- old/lollypop-1.4.4/lollypop/collection_scanner.py 2020-10-23 22:36:20.000000000 +0200 +++ new/lollypop-1.4.5/lollypop/collection_scanner.py 2020-10-24 21:46:21.000000000 +0200 @@ -95,9 +95,11 @@ if self.is_locked() and scan_type != ScanType.EXTERNAL: self.stop() GLib.timeout_add(250, self.update, scan_type, uris) + return elif App().ws_director.collection_ws is not None and\ not App().ws_director.collection_ws.stop(): GLib.timeout_add(250, self.update, scan_type, uris) + return else: if scan_type == ScanType.FULL: uris = App().settings.get_music_uris() @@ -499,6 +501,7 @@ @thread safe """ try: + self.__items = [] App().art.clean_rounded() (files, dirs, streams) = self.__get_objects_for_uris( scan_type, uris) @@ -529,19 +532,18 @@ files, db_mtimes, scan_type) threads.append(thread) - - if scan_type == ScanType.EXTERNAL: - storage_type = StorageType.EXTERNAL - else: - storage_type = StorageType.COLLECTION while threads: - sleep(1) + sleep(0.1) thread = threads[0] if not thread.is_alive(): threads.remove(thread) SqlCursor.add(App().db) - self.__items = self.__save_in_db(storage_type) + if scan_type == ScanType.EXTERNAL: + storage_type = StorageType.EXTERNAL + else: + storage_type = StorageType.COLLECTION + self.__items += self.__save_in_db(storage_type) # Add streams to DB, only happening on command line/m3u files self.__items += self.__save_streams_in_db(streams, storage_type) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lollypop-1.4.4/meson.build new/lollypop-1.4.5/meson.build --- old/lollypop-1.4.4/meson.build 2020-10-23 22:36:20.000000000 +0200 +++ new/lollypop-1.4.5/meson.build 2020-10-24 21:46:21.000000000 +0200 @@ -1,5 +1,5 @@ project('lollypop', - version: '1.4.4', + version: '1.4.5', meson_version: '>= 0.46.0' ) revision = run_command('bin/revision.sh').stdout().strip()