diff -Nru lollypop-1.4.7.r90.g765cf1b3/.buildconfig lollypop-1.4.16.r6.ga09712088/.buildconfig
--- lollypop-1.4.7.r90.g765cf1b3/.buildconfig 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/.buildconfig 1970-01-01 00:00:00.000000000 +0000
@@ -1,10 +0,0 @@
-[default]
-name=Default
-runtime=host
-config-opts=
-run-opts=
-prefix=/usr/local
-app-id=
-postbuild=
-prebuild=
-default=true
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-artists-list-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-artists-list-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-artists-list-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-artists-list-symbolic.svg 2021-02-25 23:00:18.000000000 +0000
@@ -0,0 +1,3 @@
+
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-equalizer-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-equalizer-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-equalizer-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-equalizer-symbolic.svg 2021-02-25 23:00:18.000000000 +0000
@@ -0,0 +1,132 @@
+
+
+
+
\ No newline at end of file
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-play-queue-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-play-queue-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-play-queue-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-play-queue-symbolic.svg 2021-02-25 23:00:18.000000000 +0000
@@ -0,0 +1,3 @@
+
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-sidebar-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-sidebar-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-sidebar-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-sidebar-symbolic.svg 2021-02-25 23:00:18.000000000 +0000
@@ -0,0 +1,6 @@
+
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-spotify-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-spotify-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-spotify-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-spotify-symbolic.svg 2021-02-25 23:00:18.000000000 +0000
@@ -0,0 +1,57 @@
+
+
+
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-suggestions-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-suggestions-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-suggestions-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-suggestions-symbolic.svg 2021-02-25 23:00:18.000000000 +0000
@@ -0,0 +1,6 @@
+
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-tag-list-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-tag-list-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-tag-list-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-tag-list-symbolic.svg 2021-02-25 23:00:18.000000000 +0000
@@ -0,0 +1,3 @@
+
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-tag-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-tag-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-tag-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-tag-symbolic.svg 2021-02-25 23:00:18.000000000 +0000
@@ -0,0 +1,35 @@
+
+
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-unplayed-albums-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-unplayed-albums-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-unplayed-albums-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/actions/org.gnome.Lollypop-unplayed-albums-symbolic.svg 2021-02-25 23:00:18.000000000 +0000
@@ -0,0 +1,3 @@
+
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-artists-list-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-artists-list-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-artists-list-symbolic.svg 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-artists-list-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,3 +0,0 @@
-
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-equalizer-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-equalizer-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-equalizer-symbolic.svg 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-equalizer-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,132 +0,0 @@
-
-
-
-
\ No newline at end of file
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-gradio-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-gradio-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-gradio-symbolic.svg 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-gradio-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,46 +0,0 @@
-
-
-
-
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-play-queue-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-play-queue-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-play-queue-symbolic.svg 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-play-queue-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,3 +0,0 @@
-
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-sidebar-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-sidebar-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-sidebar-symbolic.svg 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-sidebar-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,6 +0,0 @@
-
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-spotify-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-spotify-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-spotify-symbolic.svg 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-spotify-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,57 +0,0 @@
-
-
-
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-suggestions-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-suggestions-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-suggestions-symbolic.svg 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-suggestions-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,6 +0,0 @@
-
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-tag-list-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-tag-list-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-tag-list-symbolic.svg 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-tag-list-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,3 +0,0 @@
-
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-tag-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-tag-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-tag-symbolic.svg 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-tag-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,35 +0,0 @@
-
-
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-unplayed-albums-symbolic.svg lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-unplayed-albums-symbolic.svg
--- lollypop-1.4.7.r90.g765cf1b3/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-unplayed-albums-symbolic.svg 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/icons/hicolor/scalable/apps/org.gnome.Lollypop-unplayed-albums-symbolic.svg 1970-01-01 00:00:00.000000000 +0000
@@ -1,3 +0,0 @@
-
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/lollypop.gresource.xml lollypop-1.4.16.r6.ga09712088/data/lollypop.gresource.xml
--- lollypop-1.4.7.r90.g765cf1b3/data/lollypop.gresource.xml 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/lollypop.gresource.xml 2021-02-25 23:00:18.000000000 +0000
@@ -21,7 +21,6 @@
SmartPlaylistWidget.uiToolbarEnd.uiTuneinPopover.ui
- TypeAhead.uiAboutDialog.ui
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/org.gnome.Lollypop.appdata.xml.in lollypop-1.4.16.r6.ga09712088/data/org.gnome.Lollypop.appdata.xml.in
--- lollypop-1.4.7.r90.g765cf1b3/data/org.gnome.Lollypop.appdata.xml.in 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/org.gnome.Lollypop.appdata.xml.in 2021-02-25 23:00:18.000000000 +0000
@@ -17,7 +17,7 @@
-
+
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/org.gnome.Lollypop.gschema.xml lollypop-1.4.16.r6.ga09712088/data/org.gnome.Lollypop.gschema.xml
--- lollypop-1.4.7.r90.g765cf1b3/data/org.gnome.Lollypop.gschema.xml 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/org.gnome.Lollypop.gschema.xml 2021-02-25 23:00:18.000000000 +0000
@@ -365,17 +365,17 @@
- 'album'
+ 'none'ReplayGain state
- 3.0
+ 0ReplayGain value in dBBetween -15 and 15
- true
+ falseApplies signal compression/limiting to raw audio dataIt performs strict hard limiting with soft-knee characteristics, using a threshold of -6 dB
diff -Nru lollypop-1.4.7.r90.g765cf1b3/data/TypeAhead.ui lollypop-1.4.16.r6.ga09712088/data/TypeAhead.ui
--- lollypop-1.4.7.r90.g765cf1b3/data/TypeAhead.ui 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/data/TypeAhead.ui 1970-01-01 00:00:00.000000000 +0000
@@ -1,102 +0,0 @@
-
-
-
-
-
-
-
-
-
diff -Nru lollypop-1.4.7.r90.g765cf1b3/debian/changelog lollypop-1.4.16.r6.ga09712088/debian/changelog
--- lollypop-1.4.7.r90.g765cf1b3/debian/changelog 2020-12-28 23:00:17.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/debian/changelog 2021-02-25 23:00:24.000000000 +0000
@@ -1,5 +1,5 @@
-lollypop (1.4.7.r90.g765cf1b3-1~focal) focal; urgency=medium
+lollypop (1.4.16.r6.ga09712088-1~focal) focal; urgency=medium
- * 1.4.7.r90.g765cf1b3-1
+ * 1.4.16.r6.ga09712088-1
- -- Tue, 29 Dec 2020 00:00:17 +0100
+ -- Fri, 26 Feb 2021 00:00:24 +0100
diff -Nru lollypop-1.4.7.r90.g765cf1b3/.gitignore lollypop-1.4.16.r6.ga09712088/.gitignore
--- lollypop-1.4.7.r90.g765cf1b3/.gitignore 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/.gitignore 2021-02-25 23:00:18.000000000 +0000
@@ -7,6 +7,7 @@
/*.rej
/*.tab.c
/*~
+/.buildconfig
/.*.sw[nop]
/.deps
/.dirstamp
@@ -83,5 +84,6 @@
/flatpak/*.flatpak
/flatpak/.flatpak-builder
/_build
+/local
/builddir
.vscode/
diff -Nru lollypop-1.4.7.r90.g765cf1b3/.gitlab-ci.yml lollypop-1.4.16.r6.ga09712088/.gitlab-ci.yml
--- lollypop-1.4.7.r90.g765cf1b3/.gitlab-ci.yml 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/.gitlab-ci.yml 2021-02-25 23:00:18.000000000 +0000
@@ -5,9 +5,10 @@
GIT_SUBMODULE_STRATEGY: recursive
flatpak:
+ image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.38'
variables:
MANIFEST_PATH: "org.gnome.Lollypop.json"
FLATPAK_MODULE: "lollypop"
- RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
+ RUNTIME_REPO: "https://flathub.org/repo/flathub.flatpakrepo"
APP_ID: "org.gnome.Lollypop"
extends: .flatpak
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/application_actions.py lollypop-1.4.16.r6.ga09712088/lollypop/application_actions.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/application_actions.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/application_actions.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/application_cmdline.py lollypop-1.4.16.r6.ga09712088/lollypop/application_cmdline.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/application_cmdline.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/application_cmdline.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -106,12 +106,15 @@
@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()
+ try:
+ if options.contains("version"):
+ print(self.__version)
+ exit(0)
+ self.register(None)
+ if self.get_is_remote():
+ Gdk.notify_startup_complete()
+ except Exception as e:
+ Logger.error("Application::__on_handle_local_options(): %s", e)
return -1
def __on_command_line(self, app, app_cmd_line):
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/application.py lollypop-1.4.16.r6.ga09712088/lollypop/application.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/application.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/application.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -60,17 +60,19 @@
- Create main window
"""
- def __init__(self, version, data_dir):
+ def __init__(self, version, data_dir, app_id):
"""
Create application
@param version as str
@param data_dir as str
+ @param app_id as str
"""
Gtk.Application.__init__(
self,
- application_id="org.gnome.Lollypop",
+ application_id=app_id,
flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE)
ApplicationCmdline.__init__(self, version)
+ self.__app_id = app_id
self.__data_dir = data_dir
self.set_property("register-session", True)
signal(SIGINT, lambda a, b: self.quit())
@@ -83,16 +85,11 @@
GLib.setenv("PULSE_PROP_media.role", "music", True)
GLib.setenv("PULSE_PROP_application.icon_name",
"org.gnome.Lollypop", True)
- # Ideally, we will be able to delete this once Flatpak has a solution
- # for SSL certificate management inside of applications.
+ # Flatpak hacks
if GLib.file_test("/app", GLib.FileTest.EXISTS):
- paths = ["/etc/ssl/certs/ca-certificates.crt",
- "/etc/pki/tls/cert.pem",
- "/etc/ssl/cert.pem"]
- for path in paths:
- if GLib.file_test(path, GLib.FileTest.EXISTS):
- GLib.setenv("SSL_CERT_FILE", path, True)
- break
+ # Set /tmp for GLib, /tmp not accessible in flatpak
+ tmp = GLib.environ_getenv(GLib.get_environ(), "XDG_RUNTIME_DIR")
+ GLib.setenv("TMPDIR", "%s/app/org.gnome.Lollypop" % tmp, True)
self.cursors = {}
self.shown_sidebar_tooltip = False
self.__window = None
@@ -134,6 +131,15 @@
styleContext = Gtk.StyleContext()
styleContext.add_provider_for_screen(screen, cssProvider,
Gtk.STYLE_PROVIDER_PRIORITY_USER)
+ # Devel version, load devel theme
+ if self.__app_id is None:
+ css = "*:selected{ background-color: red; }"
+ cssProvider = Gtk.CssProvider()
+ cssProvider.load_from_data(css.encode("utf-8"))
+ screen = Gdk.Screen.get_default()
+ styleContext = Gtk.StyleContext()
+ styleContext.add_provider_for_screen(
+ screen, cssProvider, Gtk.STYLE_PROVIDER_PRIORITY_USER + 1)
self.db = Database()
self.cache = CacheDatabase()
self.playlists = Playlists()
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/app_notification.py lollypop-1.4.16.r6.ga09712088/lollypop/app_notification.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/app_notification.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/app_notification.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -18,12 +18,13 @@
Show a notification to user with a button connected to an action
"""
- def __init__(self, message, button_labels, actions):
+ def __init__(self, message, button_labels, actions, timeout=None):
"""
Init notification
@param message as str
@param button_label as [str]
@param action as [callback]
+ @param timeout as int
"""
Gtk.Revealer.__init__(self)
widget = Gtk.Grid()
@@ -48,6 +49,8 @@
self.add(widget)
self.set_property("halign", Gtk.Align.CENTER)
self.set_property("valign", Gtk.Align.START)
+ if timeout is not None:
+ GLib.timeout_add(timeout, self.destroy)
#######################
# PRIVATE #
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_album.py lollypop-1.4.16.r6.ga09712088/lollypop/artwork_album.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_album.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/artwork_album.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -397,7 +397,7 @@
art_uri = "%s/%s" % (album.uri, self.__favorite)
art_uri = self.add_extension(art_uri)
# Save cover to tags
- if save_to_tags:
+ if save_to_tags and data is not None:
helper = TaskHelper()
helper.run(self.__add_to_tags, album, data)
# We need to remove favorite if exists
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_artist.py lollypop-1.4.16.r6.ga09712088/lollypop/artwork_artist.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_artist.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/artwork_artist.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_downloader_album.py lollypop-1.4.16.r6.ga09712088/lollypop/artwork_downloader_album.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_downloader_album.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/artwork_downloader_album.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_downloader_artist.py lollypop-1.4.16.r6.ga09712088/lollypop/artwork_downloader_artist.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_downloader_artist.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/artwork_downloader_artist.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_downloader.py lollypop-1.4.16.r6.ga09712088/lollypop/artwork_downloader.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_downloader.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/artwork_downloader.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_manager.py lollypop-1.4.16.r6.ga09712088/lollypop/artwork_manager.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork_manager.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/artwork_manager.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork.py lollypop-1.4.16.r6.ga09712088/lollypop/artwork.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/artwork.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/artwork.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -34,18 +34,19 @@
ArtworkManager.__init__(self)
create_dir(CACHE_PATH)
- def add_to_cache(self, name, surface, prefix):
+ def add_to_cache(self, name, surface, prefix, scale_factor):
"""
Add artwork to cache
@param name as str
@param surface as cairo.Surface
@param prefix as str
+ @param scale_factor as int
@thread safe
"""
try:
encoded = md5(name.encode("utf-8")).hexdigest()
- width = surface.get_width()
- height = surface.get_height()
+ width = surface.get_width() * scale_factor
+ height = surface.get_height() * scale_factor
cache_path = "%s/@%s@%s_%s_%s" % (CACHE_PATH,
prefix,
encoded,
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/assistant_flatpak.py lollypop-1.4.16.r6.ga09712088/lollypop/assistant_flatpak.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/assistant_flatpak.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/assistant_flatpak.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/assistant_google.py lollypop-1.4.16.r6.ga09712088/lollypop/assistant_google.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/assistant_google.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/assistant_google.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/assistant_lastfm.py lollypop-1.4.16.r6.ga09712088/lollypop/assistant_lastfm.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/assistant_lastfm.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/assistant_lastfm.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/assistant_musicbrainz.py lollypop-1.4.16.r6.ga09712088/lollypop/assistant_musicbrainz.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/assistant_musicbrainz.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/assistant_musicbrainz.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/assistant.py lollypop-1.4.16.r6.ga09712088/lollypop/assistant.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/assistant.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/assistant.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/codecs.py lollypop-1.4.16.r6.ga09712088/lollypop/codecs.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/codecs.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/codecs.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/collection_item.py lollypop-1.4.16.r6.ga09712088/lollypop/collection_item.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/collection_item.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/collection_item.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/collection_scanner.py lollypop-1.4.16.r6.ga09712088/lollypop/collection_scanner.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/collection_scanner.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/collection_scanner.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# Copyright (c) 2019 Jordi Romera
# 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
@@ -131,7 +131,8 @@
self.__pending_new_artist_ids.remove(artist_id)
item.lp_album_id = get_lollypop_album_id(item.album_name,
- item.album_artists)
+ item.album_artists,
+ item.year)
Logger.debug("CollectionScanner::save_track(): Add album: "
"%s, %s" % (item.album_name, item.album_artist_ids))
(item.new_album, item.album_id) = self.add_album(
@@ -230,7 +231,8 @@
self.__pending_new_artist_ids.remove(artist_id)
# Update lp_album_id
lp_album_id = get_lollypop_album_id(item.album_name,
- item.album_artists)
+ item.album_artists,
+ item.year)
if lp_album_id != item.lp_album_id:
App().album_art.move(item.lp_album_id, lp_album_id)
App().albums.set_lp_album_id(item.album_id, lp_album_id)
@@ -331,7 +333,7 @@
App().window.container.progress.add(self)
App().window.container.progress.set_fraction(0, self)
self.__progress_fraction = 0
- notification = AppNotification(_("Resetting database"), [], [])
+ notification = AppNotification(_("Resetting database"), [], [], 10000)
notification.show()
App().window.container.add_overlay(notification)
notification.set_reveal_child(True)
@@ -557,6 +559,8 @@
except Exception as e:
Logger.warning("CollectionScanner::__scan(): %s", e)
SqlCursor.remove(App().db)
+ App().settings.set_value("flatpak-access-migration",
+ GLib.Variant("b", True))
def __scan_to_handle(self, uri):
"""
@@ -770,8 +774,10 @@
discnumber = self.get_discnumber(tags)
discname = self.get_discname(tags)
tracknumber = self.get_tracknumber(tags, name)
- if track_rate == 0:
- track_rate = self.get_popm(tags)
+ # We have popm in tags, override history one
+ tag_track_rate = self.get_popm(tags)
+ if tag_track_rate > 0:
+ track_rate = tag_track_rate
if album_mtime == 0:
album_mtime = track_mtime
bpm = self.get_bpm(tags)
@@ -868,5 +874,3 @@
assistant.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
assistant.set_transient_for(App().window)
GLib.timeout_add(1000, assistant.show)
- App().settings.set_value("flatpak-access-migration",
- GLib.Variant("b", True))
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/container_filter.py lollypop-1.4.16.r6.ga09712088/lollypop/container_filter.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/container_filter.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/container_filter.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/container_history.py lollypop-1.4.16.r6.ga09712088/lollypop/container_history.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/container_history.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/container_history.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/container_lists.py lollypop-1.4.16.r6.ga09712088/lollypop/container_lists.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/container_lists.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/container_lists.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/container_notification.py lollypop-1.4.16.r6.ga09712088/lollypop/container_notification.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/container_notification.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/container_notification.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/container_playlists.py lollypop-1.4.16.r6.ga09712088/lollypop/container_playlists.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/container_playlists.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/container_playlists.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/container.py lollypop-1.4.16.r6.ga09712088/lollypop/container.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/container.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/container.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -58,6 +58,7 @@
"""
self.__widget = Handy.Leaflet()
self.__widget.show()
+ self.__widget.connect("notify::folded", self.__on_folded)
self.__sub_widget = Handy.Leaflet()
self.__sub_widget.show()
self.__focused_view = None
@@ -127,6 +128,7 @@
"""
if self._stack.history.count > 0:
self._stack.go_back()
+ self.set_focused_view(self._stack.get_visible_child())
elif self.__sub_widget.get_folded() and\
self.__sub_widget.get_visible_child() != self.left_list:
self.__sub_widget.set_visible_child(self.left_list)
@@ -210,6 +212,13 @@
############
# PRIVATE #
############
+ def __on_folded(self, *ignore):
+ """
+ Reload main view if needed
+ """
+ if not App().window.folded and self.view is None:
+ self.show_view(self.sidebar.selected_ids)
+
def __on_search_activate(self, action, variant):
"""
@param action as Gio.SimpleAction
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/container_scanner.py lollypop-1.4.16.r6.ga09712088/lollypop/container_scanner.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/container_scanner.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/container_scanner.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/container_stack.py lollypop-1.4.16.r6.ga09712088/lollypop/container_stack.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/container_stack.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/container_stack.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/container_views.py lollypop-1.4.16.r6.ga09712088/lollypop/container_views.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/container_views.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/container_views.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/database_albums.py lollypop-1.4.16.r6.ga09712088/lollypop/database_albums.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/database_albums.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/database_albums.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -15,7 +15,7 @@
from random import shuffle
from lollypop.sqlcursor import SqlCursor
-from lollypop.define import App, Type, OrderBy, StorageType
+from lollypop.define import App, Type, OrderBy, StorageType, LovedFlags
from lollypop.logger import Logger
from lollypop.utils import remove_static, make_subrequest
@@ -693,13 +693,16 @@
@return [int]
"""
with SqlCursor(self.__db) as sql:
+ filters = (storage_type,)
request = "SELECT DISTINCT albums.rowid\
FROM albums\
WHERE rate>=4 AND storage_type & ?"
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += "ORDER BY popularity DESC LIMIT ?"
- result = sql.execute(request, (storage_type, limit))
+ filters += (limit,)
+ result = sql.execute(request, filters)
return list(itertools.chain(*result))
def get_populars(self, storage_type, skipped, limit):
@@ -711,13 +714,15 @@
@return [int]
"""
with SqlCursor(self.__db) as sql:
+ filters = (storage_type,)
request = "SELECT DISTINCT albums.rowid FROM albums\
WHERE popularity!=0 AND storage_type & ?"
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += "ORDER BY popularity DESC LIMIT ?"
- result = sql.execute(request,
- (storage_type, limit))
+ filters += (limit,)
+ result = sql.execute(request, filters)
return list(itertools.chain(*result))
def get_populars_at_the_moment(self, storage_type, skipped, limit):
@@ -729,15 +734,18 @@
@return [int]
"""
with SqlCursor(self.__db) as sql:
+ filters = (storage_type,)
request = "SELECT DISTINCT albums.rowid\
FROM albums, albums_timed_popularity\
WHERE albums.storage_type & ? AND\
albums.rowid = albums_timed_popularity.album_id"
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += "ORDER BY albums_timed_popularity.popularity DESC\
LIMIT ?"
- result = sql.execute(request, (storage_type, limit))
+ filters += (limit,)
+ result = sql.execute(request, filters)
album_ids = list(itertools.chain(*result))
if album_ids:
return album_ids
@@ -752,9 +760,9 @@
with SqlCursor(self.__db) as sql:
request = "SELECT albums.rowid\
FROM albums\
- WHERE loved=1 AND\
+ WHERE loved & ? AND\
storage_type & ? ORDER BY popularity DESC"
- result = sql.execute(request, (storage_type,))
+ result = sql.execute(request, (LovedFlags.LOVED, storage_type,))
return list(itertools.chain(*result))
def get_recents(self, storage_type, skipped, limit):
@@ -766,12 +774,15 @@
@return [int]
"""
with SqlCursor(self.__db) as sql:
+ filters = (storage_type,)
request = "SELECT DISTINCT albums.rowid FROM albums\
WHERE albums.storage_type & ?"
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += "ORDER BY mtime DESC LIMIT ?"
- result = sql.execute(request, (storage_type, limit))
+ filters += (limit,)
+ result = sql.execute(request, filters)
return list(itertools.chain(*result))
def get_randoms_by_albums(self, storage_type, genre_id, skipped, limit):
@@ -785,23 +796,27 @@
"""
with SqlCursor(self.__db) as sql:
if genre_id is not None:
- filter = (storage_type, genre_id, limit)
+ filters = (storage_type, genre_id)
request = "SELECT DISTINCT albums.rowid\
FROM albums, album_genres\
WHERE albums.storage_type & ? AND\
album_genres.album_id = albums.rowid AND\
album_genres.genre_id = ?"
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += "ORDER BY random() LIMIT ?"
+ filters += (limit,)
else:
- filter = (storage_type, limit)
+ filters = (storage_type,)
request = "SELECT DISTINCT rowid FROM albums\
WHERE storage_type & ?"
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += "ORDER BY random() LIMIT ?"
- result = sql.execute(request, filter)
+ filters += (limit,)
+ result = sql.execute(request, filters)
albums = list(itertools.chain(*result))
return albums
@@ -816,7 +831,7 @@
"""
with SqlCursor(self.__db) as sql:
if genre_id is not None:
- filter = (storage_type, genre_id, limit * 2, limit)
+ filters = (storage_type, genre_id)
request = "SELECT rowid, artist_id FROM (\
SELECT albums.rowid, album_artists.artist_id\
FROM albums, album_genres, album_artists\
@@ -825,22 +840,26 @@
album_genres.album_id = albums.rowid AND\
album_genres.genre_id = ?"
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved & ?"
+ filters += (LovedFlags.SKIPPED,)
+ filters += (limit * 2, limit)
request += "ORDER BY random() LIMIT ?)\
GROUP BY artist_id ORDER BY random() LIMIT ?"
else:
- filter = (storage_type, limit * 2, limit)
+ filters = (storage_type,)
request = "SELECT rowid, artist_id FROM (\
SELECT albums.rowid, album_artists.artist_id\
FROM albums, album_artists\
WHERE albums.rowid = album_artists.album_id AND\
albums.storage_type & ?"
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved & ?"
+ filters += (LovedFlags.SKIPPED,)
+ filters += (limit * 2, limit)
request += "ORDER BY random() LIMIT ?)\
GROUP BY artist_id ORDER BY random() LIMIT ?"
album_ids = []
- for (album_id, artist_id) in sql.execute(request, filter):
+ for (album_id, artist_id) in sql.execute(request, filters):
album_ids.append(album_id)
return album_ids
@@ -945,14 +964,15 @@
"OR",
len(artist_ids))
if not skipped:
- request += " AND tracks.loved != -1"
+ request += " AND not tracks.loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += " ORDER BY discnumber, tracknumber, tracks.name"
result = sql.execute(request, filters)
return list(itertools.chain(*result))
def get_tracks_count(self, album_id, genre_ids, artist_ids):
"""
- Get tracks ids for album
+ Get tracks count for album
@param album_id as int
@param genre_ids as [int]
@param artist_ids as [int]
@@ -1048,15 +1068,17 @@
result = []
# Get albums for all artists
if not artist_ids and not genre_ids:
+ filters = (storage_type,)
request = "SELECT DISTINCT albums.rowid\
FROM albums, album_artists, artists\
WHERE albums.rowid = album_artists.album_id AND\
albums.storage_type & ? AND\
artists.rowid = album_artists.artist_id"
if not skipped:
- request += " AND albums.loved != -1"
+ request += " AND not albums.loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += order
- result = sql.execute(request, (storage_type,))
+ result = sql.execute(request, filters)
# Get albums for genres
elif not artist_ids:
filters = (storage_type,)
@@ -1071,7 +1093,8 @@
"OR",
len(genre_ids))
if not skipped:
- request += " AND albums.loved != -1"
+ request += " AND not albums.loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += order
result = sql.execute(request, filters)
# Get albums for artist
@@ -1087,7 +1110,8 @@
"OR",
len(artist_ids))
if not skipped:
- request += " AND albums.loved != -1"
+ request += " AND not albums.loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += order
result = sql.execute(request, filters)
# Get albums for artist id and genre id
@@ -1109,7 +1133,8 @@
"OR",
len(genre_ids))
if not skipped:
- request += " AND albums.loved != -1"
+ request += " AND not albums.loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += order
result = sql.execute(request, filters)
return list(itertools.chain(*result))
@@ -1135,7 +1160,8 @@
AND album_artists.artist_id=?\
AND album_artists.album_id=albums.rowid"
if not skipped:
- request += " AND albums.loved != -1"
+ request += " AND not albums.loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += order
result = sql.execute(request, filters)
# Get compilation for genre id
@@ -1146,14 +1172,14 @@
FROM albums, album_genres, album_artists\
WHERE album_genres.album_id=albums.rowid\
AND albums.storage_type & ?\
- AND albums.loved != -1\
AND album_artists.album_id=albums.rowid\
AND album_artists.artist_id=? AND"
request += make_subrequest("album_genres.genre_id=?",
"OR",
len(genre_ids))
if not skipped:
- request += " AND albums.loved != -1"
+ request += " AND not albums.loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += order
result = sql.execute(request, filters)
return list(itertools.chain(*result))
@@ -1242,13 +1268,16 @@
@return album ids as [int]
"""
with SqlCursor(self.__db) as sql:
+ filters = (storage_type,)
request = "SELECT album_id FROM tracks, albums\
WHERE albums.storage_type & ? AND albums.rowid=album_id"
if not skipped:
- request += " AND albums.loved != -1"
+ request += " AND not albums.loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += " GROUP BY album_id\
ORDER BY SUM(ltime)/COUNT(ltime), random() LIMIT ?"
- result = sql.execute(request, (storage_type, limit))
+ filters += (limit,)
+ result = sql.execute(request, filters)
return list(itertools.chain(*result))
def search(self, searched, storage_type):
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/database_artists.py lollypop-1.4.16.r6.ga09712088/lollypop/database_artists.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/database_artists.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/database_artists.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -14,7 +14,7 @@
import itertools
from lollypop.sqlcursor import SqlCursor
-from lollypop.define import App, Type, StorageType, OrderBy
+from lollypop.define import App, Type, StorageType, OrderBy, LovedFlags
from lollypop.utils import get_default_storage_type, make_subrequest
from lollypop.utils import format_artist_name, remove_static
@@ -243,10 +243,11 @@
WHERE album_artists.artist_id=artists.rowid\
AND album_artists.album_id=albums.rowid\
AND albums.storage_type & ?\
- AND albums.loved != -1\
+ AND not albums.loved & ?\
ORDER BY random() LIMIT ?\
COLLATE NOCASE COLLATE LOCALIZED"
- result = sql.execute(request, (storage_type, limit))
+ result = sql.execute(
+ request, (storage_type, LovedFlags.SKIPPED, limit))
return [(row[0], row[1], row[2]) for row in result]
def get_ids(self, genre_ids, storage_type):
@@ -379,7 +380,8 @@
"OR",
len(genre_ids))
if not skipped:
- request += " AND albums.loved != -1"
+ filters += (LovedFlags.SKIPPED,)
+ request += " AND not albums.loved & ?"
request += order
result = sql.execute(request, filters)
return list(itertools.chain(*result))
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/database_cache.py lollypop-1.4.16.r6.ga09712088/lollypop/database_cache.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/database_cache.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/database_cache.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/database_genres.py lollypop-1.4.16.r6.ga09712088/lollypop/database_genres.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/database_genres.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/database_genres.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -13,7 +13,7 @@
import itertools
from lollypop.sqlcursor import SqlCursor
-from lollypop.define import App, Type, OrderBy
+from lollypop.define import App, Type, OrderBy, LovedFlags
from lollypop.utils import get_network_available, sql_escape
@@ -104,6 +104,7 @@
albums.name\
COLLATE NOCASE COLLATE LOCALIZED"
with SqlCursor(self.__db) as sql:
+ filters = ()
request = "SELECT albums.rowid\
FROM albums, album_genres, genres,\
album_artists, artists\
@@ -114,9 +115,10 @@
if not get_network_available():
request += " AND albums.synced!=%s" % Type.NONE
if ignore:
- request += " AND albums.loved != -1"
+ request += " AND not albums.loved & ?"
+ filters += (LovedFlags.SKIPPED,)
request += order
- result = sql.execute(request)
+ result = sql.execute(request, filters)
return list(itertools.chain(*result))
def get(self):
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/database_history.py lollypop-1.4.16.r6.ga09712088/lollypop/database_history.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/database_history.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/database_history.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/database.py lollypop-1.4.16.r6.ga09712088/lollypop/database.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/database.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/database.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/database_tracks.py lollypop-1.4.16.r6.ga09712088/lollypop/database_tracks.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/database_tracks.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/database_tracks.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -15,7 +15,7 @@
import itertools
from lollypop.sqlcursor import SqlCursor
-from lollypop.define import App, StorageType, Type
+from lollypop.define import App, StorageType, Type, LovedFlags
from lollypop.utils import noaccents, make_subrequest
@@ -107,12 +107,14 @@
@return track ids as [int]
"""
with SqlCursor(self.__db) as sql:
+ filters = (storage_type,)
request = "SELECT rowid FROM tracks\
WHERE storage_type & ?"
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved &? "
+ filters += (LovedFlags.SKIPPED,)
request += " ORDER BY album_id"
- result = sql.execute(request, (storage_type,))
+ result = sql.execute(request, filters)
return list(itertools.chain(*result))
def get_ids_for_name(self, name):
@@ -602,10 +604,10 @@
@return [int]
"""
with SqlCursor(self.__db) as sql:
- filters = (storage_type,)
+ filters = (LovedFlags.LOVED, storage_type)
request = "SELECT tracks.rowid\
FROM tracks, album_artists, artists\
- WHERE loved=1 AND\
+ WHERE loved=? AND\
artists.rowid=album_artists.artist_id AND\
tracks.album_id=album_artists.album_id AND\
storage_type & ?"
@@ -615,7 +617,7 @@
request += make_subrequest("album_artists.artist_id=?",
"OR",
len(artist_ids))
- request += "ORDER BY artists.name"
+ request += " ORDER BY artists.name"
result = sql.execute(request, filters)
return list(itertools.chain(*result))
@@ -643,7 +645,8 @@
"OR",
len(artist_ids))
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved &? "
+ filters += (LovedFlags.SKIPPED,)
filters += (limit,)
request += " ORDER BY popularity DESC LIMIT ?"
result = sql.execute(request, filters)
@@ -664,7 +667,8 @@
"OR",
len(artist_ids))
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved &? "
+ filters += (LovedFlags.SKIPPED,)
filters += (limit,)
request += " ORDER BY popularity DESC LIMIT ?"
result = sql.execute(request, filters)
@@ -753,12 +757,15 @@
@return tracks as [int]
"""
with SqlCursor(self.__db) as sql:
+ filters = (storage_type,)
request = "SELECT tracks.rowid FROM tracks\
WHERE ltime!=0 AND storage_type & ?"
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved &? "
+ filters += (LovedFlags.SKIPPED,)
request += " ORDER BY ltime DESC LIMIT ?"
- result = sql.execute(request, (storage_type, limit))
+ filters += (limit,)
+ result = sql.execute(request, filters)
return list(itertools.chain(*result))
def get_skipped(self, storage_type):
@@ -769,8 +776,8 @@
"""
with SqlCursor(self.__db) as sql:
request = "SELECT rowid FROM tracks\
- WHERE loved=-1 AND storage_type & ?"
- result = sql.execute(request, (storage_type,))
+ WHERE loved & ? AND storage_type & ?"
+ result = sql.execute(request, (LovedFlags.SKIPPED, storage_type))
return list(itertools.chain(*result))
def get_randoms(self, genre_ids, storage_type, skipped, limit):
@@ -789,7 +796,8 @@
request += ",track_genres"
request += " WHERE storage_type & ? "
if not skipped:
- request += " AND loved != -1 "
+ request += " AND not loved &? "
+ filters += (LovedFlags.SKIPPED,)
if genre_ids:
request += "AND tracks.rowid=track_genres.track_id"
filters += tuple(genre_ids)
@@ -841,25 +849,28 @@
return v[0]
return 0
- def get_year_for_album(self, album_id, disc_number):
+ def get_year_for_album(self, album_id, disc_number=None):
"""
Get album year based on tracks
Use most used year by tracks
@param album_id as int
- @param disc_number as int
+ @param disc_number as int/None
@return int
"""
with SqlCursor(self.__db) as sql:
- result = sql.execute("SELECT year, COUNT(year) AS occurrence\
- FROM tracks\
- WHERE tracks.album_id=? AND\
- tracks.discnumber=?\
- GROUP BY year\
- ORDER BY occurrence DESC\
- LIMIT 1", (album_id, disc_number))
- v = result.fetchone()
- if v is not None:
- return v[0]
+ filters = (album_id,)
+ request = "SELECT year, COUNT(year) AS occurrence FROM tracks\
+ WHERE tracks.album_id=?"
+ if disc_number is not None:
+ filters += (disc_number,)
+ request += " AND tracks.discnumber=?"
+ request += " GROUP BY year\
+ ORDER BY occurrence DESC"
+ result = sql.execute(request, filters)
+ v = list(result)
+ # Ignore album with multiple original date
+ if len(v) == 1:
+ return v[0][0]
return None
def get_ltime(self, track_id):
@@ -929,18 +940,20 @@
COLLATE NOCASE COLLATE LOCALIZED LIMIT ?"
request = "SELECT DISTINCT tracks.album_id,\
discnumber,\
- discname\
+ discname,\
+ albums.year\
FROM albums, tracks, album_artists, artists\
WHERE albums.rowid=album_artists.album_id AND\
artists.rowid=album_artists.artist_id AND\
tracks.album_id=albums.rowid AND\
tracks.year=? AND albums.storage_type & ?"
- filter = (year, storage_type, limit)
+ filters = (year, storage_type, limit)
if not skipped:
- request += " AND albums.loved != -1"
+ request += " AND not albums.loved &? "
+ filters += (LovedFlags.SKIPPED,)
request += " GROUP BY tracks.album_id"
request += order
- result = sql.execute(request, filter)
+ result = sql.execute(request, filters)
return list(result)
def get_compilations_by_disc_for_year(self, year, storage_type,
@@ -958,19 +971,21 @@
COLLATE NOCASE COLLATE LOCALIZED LIMIT ?"
request = "SELECT DISTINCT tracks.album_id,\
discnumber,\
- discname\
+ discname,\
+ albums.year\
FROM albums, album_artists, tracks\
WHERE album_artists.artist_id=?\
AND album_artists.album_id=albums.rowid\
AND tracks.album_id=albums.rowid\
AND albums.storage_type & ?\
AND tracks.year=?"
- filter = (Type.COMPILATIONS, storage_type, year, limit)
+ filters = (Type.COMPILATIONS, storage_type, year, limit)
if not skipped:
- request += " AND albums.loved != -1"
+ request += " AND not albums.loved &? "
+ filters += (LovedFlags.SKIPPED,)
request += " GROUP BY tracks.album_id"
request += order
- result = sql.execute(request, filter)
+ result = sql.execute(request, filters)
return list(result)
def set_lp_track_id(self, track_id, lp_track_id):
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/database_upgrade.py lollypop-1.4.16.r6.ga09712088/lollypop/database_upgrade.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/database_upgrade.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/database_upgrade.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -173,7 +173,8 @@
44: self.__upgrade_44,
45: self.__upgrade_45,
46: self.__upgrade_46,
- 47: self.__upgrade_47
+ 47: self.__upgrade_47,
+ 48: self.__upgrade_48,
}
#######################
@@ -824,3 +825,15 @@
"""
from lollypop.art import clean_all_cache
clean_all_cache()
+
+ def __upgrade_48(self, db):
+ """
+ Convert loved to new flags
+ """
+ with SqlCursor(db, True) as sql:
+ sql.execute("UPDATE tracks set loved=2 where loved=1")
+ sql.execute("UPDATE tracks set loved=1 where loved=0")
+ sql.execute("UPDATE tracks set loved=4 where loved=-1")
+ sql.execute("UPDATE albums set loved=2 where loved=1")
+ sql.execute("UPDATE albums set loved=1 where loved=0")
+ sql.execute("UPDATE albums set loved=4 where loved=-1")
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/define.py lollypop-1.4.16.r6.ga09712088/lollypop/define.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/define.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/define.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -64,6 +64,12 @@
ALL = 4
+class LovedFlags:
+ NONE = 1 << 0
+ LOVED = 1 << 1
+ SKIPPED = 1 << 2
+
+
class GstPlayFlags:
GST_PLAY_FLAG_VIDEO = 1 << 0 # We want video output
GST_PLAY_FLAG_AUDIO = 1 << 1 # We want audio output
@@ -157,7 +163,7 @@
NONE = 1 << 0
PLAY = 1 << 1
LOVED = 1 << 2
- SKIP = 1 << 3
+ SKIPPED = 1 << 3
LOADING = 1 << 4
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/dialog_apps.py lollypop-1.4.16.r6.ga09712088/lollypop/dialog_apps.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/dialog_apps.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/dialog_apps.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/dialog_settings.py lollypop-1.4.16.r6.ga09712088/lollypop/dialog_settings.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/dialog_settings.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/dialog_settings.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -95,8 +95,8 @@
passwords_helper.get("LIBREFM", self.__on_get_password,
builder.get_object("librefm_button"))
builder.connect_signals(self)
- self.__multi_press = Gtk.EventControllerKey.new(self.__settings_dialog)
- self.__multi_press.connect("key-released", self.__on_key_released)
+ self.__controller = Gtk.EventControllerKey.new(self.__settings_dialog)
+ self.__controller.connect("key-released", self.__on_key_released)
def show(self):
"""
@@ -149,6 +149,10 @@
setting = widget.get_name()
value = widget.get_active()
App().settings.set_enum(setting, value)
+ if setting == "replay-gain":
+ for plugin in App().player.plugins:
+ plugin.build_audiofilter()
+ App().player.reload_track()
def _on_clean_artwork_cache_clicked(self, button):
"""
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/fastscroll.py lollypop-1.4.16.r6.ga09712088/lollypop/fastscroll.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/fastscroll.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/fastscroll.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/fullscreen.py lollypop-1.4.16.r6.ga09712088/lollypop/fullscreen.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/fullscreen.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/fullscreen.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -53,18 +53,8 @@
self.__signal1_id = self.__signal2_id = None
self.__background_id = None
self.set_decorated(False)
- # Calculate cover size
- screen = Gdk.Screen.get_default()
- monitor = screen.get_monitor_at_window(App().main_window.get_window())
- geometry = screen.get_monitor_geometry(monitor)
- art_size_fs = ArtSize.FULLSCREEN / self.get_scale_factor()
- font_size_fs = 30 / self.get_scale_factor()
- if geometry.width > geometry.height:
- art_size = int(art_size_fs * geometry.height / 1080)
- font_size = int(font_size_fs * geometry.height / 1080)
- else:
- art_size = int(art_size_fs * geometry.width / 1920)
- font_size = int(font_size_fs * geometry.width / 1920)
+ art_size = ArtSize.FULLSCREEN
+ font_size = 30
builder = Gtk.Builder()
builder.add_from_resource("/org/gnome/Lollypop/FullScreen.ui")
builder.connect_signals(self)
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_adaptive.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_adaptive.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_adaptive.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_adaptive.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_art.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_art.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_art.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_art.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_dnd.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_dnd.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_dnd.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_dnd.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -13,6 +13,7 @@
from gi.repository import Gdk, Gtk, GLib, GObject
from lollypop.objects_album import Album
+from lollypop.define import App
from lollypop.utils import set_cursor_type
from lollypop.widgets_row_album import AlbumRow
from lollypop.widgets_row_track import TrackRow
@@ -83,6 +84,11 @@
self.__listbox.remove(next)
else:
children.pop(0)
+ for album_row in self.__listbox.get_children():
+ if album_row.album.id == App().player.current_track.album.id:
+ for track_row in album_row.children:
+ if track_row.track.id == App().player.current_track.id:
+ App().player._current_track = track_row.track
GLib.timeout_add(100, self.emit, "dnd-finished")
def __do_drag_and_drop(self, src_rows, dest_row, direction):
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_filtering.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_filtering.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_filtering.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_filtering.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_gestures.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_gestures.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_gestures.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_gestures.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_horizontal_scrolling.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_horizontal_scrolling.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_horizontal_scrolling.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_horizontal_scrolling.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_lyrics.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_lyrics.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_lyrics.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_lyrics.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_passwords.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_passwords.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_passwords.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_passwords.py 2021-02-25 23:00:18.000000000 +0000
@@ -26,9 +26,9 @@
"""
Init helper
"""
- self.__secret = None
- Secret.Service.get(Secret.ServiceFlags.LOAD_COLLECTIONS, None,
- self.__on_get_secret)
+ # Initial password lookup, prevent a lock issue in Flatpak backend
+ if GLib.file_test("/app", GLib.FileTest.EXISTS):
+ self.get_token("LASTFM")
def get_token(self, service):
"""
@@ -36,7 +36,6 @@
@param service as str
"""
try:
- secret = Secret.Service.get_sync(Secret.ServiceFlags.NONE)
SecretSchema = {
"service": Secret.SchemaAttributeType.STRING
}
@@ -46,15 +45,9 @@
schema = Secret.Schema.new("org.gnome.Lollypop",
Secret.SchemaFlags.NONE,
SecretSchema)
- items = secret.search_sync(schema, SecretAttributes,
- Secret.SearchFlags.UNLOCK |
- Secret.SearchFlags.LOAD_SECRETS,
- None)
- if items:
- items[0].load_secret_sync(None)
- value = items[0].get_secret()
- if value is not None:
- return value.get_text()
+ password = Secret.password_lookup_sync(schema, SecretAttributes,
+ None)
+ return password
except Exception as e:
Logger.error("PasswordsHelper::get_token(): %s" % e)
return None
@@ -67,7 +60,6 @@
@param args
"""
try:
- self.__wait_for_secret(self.get, service, callback, *args)
SecretSchema = {
"service": Secret.SchemaAttributeType.STRING
}
@@ -77,14 +69,15 @@
schema = Secret.Schema.new("org.gnome.Lollypop",
Secret.SchemaFlags.NONE,
SecretSchema)
- self.__secret.search(schema, SecretAttributes,
- Secret.SearchFlags.UNLOCK |
- Secret.SearchFlags.LOAD_SECRETS,
- None,
- self.__on_secret_search,
- service,
- callback,
- *args)
+ Secret.password_search(schema,
+ SecretAttributes,
+ Secret.SearchFlags.UNLOCK |
+ Secret.SearchFlags.LOAD_SECRETS,
+ None,
+ self.__on_secret_search,
+ service,
+ callback,
+ *args)
except Exception as e:
Logger.warning("PasswordsHelper::get(): %s" % e)
@@ -97,12 +90,6 @@
@param callback as function
"""
try:
- self.__wait_for_secret(self.store,
- service,
- login,
- password,
- callback,
- *args)
schema_string = "org.gnome.Lollypop: %s@%s" % (service, login)
SecretSchema = {
"service": Secret.SchemaAttributeType.STRING,
@@ -132,7 +119,6 @@
@param callback as function
"""
try:
- self.__wait_for_secret(self.clear, service, callback, *args)
SecretSchema = {
"service": Secret.SchemaAttributeType.STRING
}
@@ -142,45 +128,28 @@
schema = Secret.Schema.new("org.gnome.Lollypop",
Secret.SchemaFlags.NONE,
SecretSchema)
- self.__secret.search(schema,
- SecretAttributes,
- Secret.SearchFlags.UNLOCK |
- Secret.SearchFlags.LOAD_SECRETS,
- None,
- self.__on_clear_search,
- callback,
- *args)
+ Secret.password_clear(schema,
+ SecretAttributes,
+ None,
+ self.__on_clear_search,
+ callback,
+ *args)
except Exception as e:
Logger.warning("PasswordsHelper::clear(): %s" % e)
#######################
# PRIVATE #
#######################
- def __wait_for_secret(self, call, *args):
- """
- Wait for secret
- @param call as function to call
- @param args
- @raise exception if waiting
- """
- # Wait for secret
- if self.__secret is None:
- GLib.timeout_add(250, call, *args)
- raise Exception("Waiting Secret service")
- elif self.__secret == -1:
- raise Exception("Error waiting for Secret service")
-
def __on_clear_search(self, source, result, callback=None, *args):
"""
Clear passwords
@param source as GObject.Object
@param result as Gio.AsyncResult
+ @param callback as function
"""
try:
if result is not None:
- items = source.search_finish(result)
- for item in items:
- item.delete(None, None)
+ Secret.password_clear_finish(result)
if callback is not None:
callback(*args)
except Exception as e:
@@ -197,10 +166,10 @@
"""
try:
if result is not None:
- items = source.search_finish(result)
+ items = Secret.password_search_finish(result)
for item in items:
attributes = item.get_attributes()
- secret = item.get_secret()
+ secret = item.retrieve_secret_sync()
callback(attributes,
secret.get().decode('utf-8'),
service,
@@ -212,15 +181,3 @@
except Exception as e:
Logger.error("PasswordsHelper::__on_secret_search(): %s" % e)
callback(None, None, service, *args)
-
- def __on_get_secret(self, source, result):
- """
- Store secret proxy
- @param source as GObject.Object
- @param result as Gio.AsyncResult
- """
- try:
- self.__secret = source.get_finish(result)
- except Exception as e:
- self.__secret = -1
- Logger.error("PasswordsHelper::__on_get_secret(): %s" % e)
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_signals.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_signals.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_signals.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_signals.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_size_allocation.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_size_allocation.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_size_allocation.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_size_allocation.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_task.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_task.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_task.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_task.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_web_base.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_web_base.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_web_base.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_web_base.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_web_invidious.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_web_invidious.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_web_invidious.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_web_invidious.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_web.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_web.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_web.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_web.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_web_wikipedia.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_web_wikipedia.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_web_wikipedia.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_web_wikipedia.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_web_youtube.py lollypop-1.4.16.r6.ga09712088/lollypop/helper_web_youtube.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/helper_web_youtube.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/helper_web_youtube.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/information_downloader.py lollypop-1.4.16.r6.ga09712088/lollypop/information_downloader.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/information_downloader.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/information_downloader.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/information_store.py lollypop-1.4.16.r6.ga09712088/lollypop/information_store.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/information_store.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/information_store.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/inotify.py lollypop-1.4.16.r6.ga09712088/lollypop/inotify.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/inotify.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/inotify.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/list.py lollypop-1.4.16.r6.ga09712088/lollypop/list.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/list.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/list.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/localized.py lollypop-1.4.16.r6.ga09712088/lollypop/localized.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/localized.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/localized.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_actions.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_actions.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_actions.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_actions.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -38,7 +38,8 @@
else:
self.__object = Track(object.id)
self.__set_save_action()
- if self.__object.storage_type & StorageType.COLLECTION:
+ if self.__object.storage_type & StorageType.COLLECTION and\
+ not GLib.file_test("/app", GLib.FileTest.EXISTS):
self.__set_open_action()
#######################
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_application.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_application.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_application.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_application.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_artist.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_artist.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_artist.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_artist.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_artwork.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_artwork.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_artwork.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_artwork.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# Copyright (c) 2020 CodedOre
# 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
@@ -54,7 +54,7 @@
emit_signal(self, "hidden", True)
@property
- def section_name(self):
+ def section(self):
return None
@property
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_current_albums.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_current_albums.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_current_albums.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_current_albums.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_decade.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_decade.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_decade.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_decade.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_genre.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_genre.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_genre.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_genre.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_header.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_header.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_header.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_header.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_objects.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_objects.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_objects.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_objects.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_playback.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_playback.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_playback.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_playback.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -14,7 +14,7 @@
from gettext import gettext as _
-from lollypop.define import App, ViewType, Type
+from lollypop.define import App, ViewType, Type, LovedFlags
from lollypop.utils_album import tracks_to_albums
from lollypop.utils import get_default_storage_type, emit_signal
from lollypop.utils import get_network_available
@@ -283,6 +283,7 @@
menu_item.set_attribute_value("close", GLib.Variant("b", True))
self.append_item(menu_item)
self._set_playback_actions()
+ self.__set_skipped_action()
if get_network_available("SPOTIFY") or\
get_network_available("LASTFM") or\
get_network_available("DEEZER"):
@@ -325,6 +326,42 @@
#######################
# PRIVATE #
#######################
+ def __set_skipped_action(self):
+ """
+ Set skipped action
+ """
+ album_ids = App().albums.get_ids([], [self.__artist_id],
+ self.__storage_type, False)
+ skipped = True
+ for album_id in album_ids:
+ album = Album(album_id)
+ if not album.loved & LovedFlags.SKIPPED:
+ skipped = False
+ break
+ action = Gio.SimpleAction.new_stateful(
+ "skip-artist",
+ None,
+ GLib.Variant.new_boolean(skipped))
+ App().add_action(action)
+ action.connect("change-state", self.__on_loved_change_state)
+ self.append(_("Ignored"), "app.skip-artist")
+
+ def __on_loved_change_state(self, action, state):
+ """
+ Update Skipped state
+ @param action as Gio.SimpleAction
+ @param state as bool
+ """
+ action.set_state(state)
+ album_ids = App().albums.get_ids([], [self.__artist_id],
+ self.__storage_type, False)
+ for album_id in album_ids:
+ album = Album(album_id)
+ if state:
+ album.set_loved(album.loved | LovedFlags.SKIPPED)
+ else:
+ album.set_loved(album.loved & ~LovedFlags.SKIPPED)
+
def __on_play_action_activate(self, action, variant):
"""
Play albums
@@ -519,6 +556,14 @@
menu_item.set_attribute_value("close", GLib.Variant("b", True))
self.append_item(menu_item)
self._set_playback_actions()
+ action = Gio.SimpleAction.new_stateful(
+ "skip-album",
+ None,
+ GLib.Variant.new_boolean(
+ self.__album.loved & LovedFlags.SKIPPED))
+ App().add_action(action)
+ action.connect("change-state", self.__on_loved_change_state)
+ self.append(_("Ignored"), "app.skip-album")
if get_network_available("SPOTIFY") or\
get_network_available("LASTFM") or\
get_network_available("DEEZER"):
@@ -559,11 +604,23 @@
#######################
# PRIVATE #
#######################
+ def __on_loved_change_state(self, action, state):
+ """
+ Update Skipped state
+ @param action as Gio.SimpleAction
+ @param state as bool
+ """
+ action.set_state(state)
+ if state:
+ self.__album.set_loved(self.__album.loved | LovedFlags.SKIPPED)
+ else:
+ self.__album.set_loved(self.__album.loved & ~LovedFlags.SKIPPED)
+
def __on_play_action_activate(self, action, variant):
"""
Play album
- @param Gio.SimpleAction
- @param GLib.Variant
+ @param action as Gio.SimpleAction
+ @param variant as GLib.Variant
"""
App().player.play_album(self.__album.clone(True))
@@ -585,6 +642,14 @@
self._set_playback_actions()
self.__set_queue_actions()
self.__set_stop_after_action()
+ action = Gio.SimpleAction.new_stateful(
+ "skip-track",
+ None,
+ GLib.Variant.new_boolean(
+ self.__track.loved & LovedFlags.SKIPPED))
+ App().add_action(action)
+ action.connect("change-state", self.__on_loved_change_state)
+ self.append(_("Ignored"), "app.skip-track")
@property
def in_player(self):
@@ -693,3 +758,15 @@
"""
App().player.remove_from_queue(self.__track.id, False)
emit_signal(App().player, "queue-changed")
+
+ def __on_loved_change_state(self, action, state):
+ """
+ Update Skipped state
+ @param action as Gio.SimpleAction
+ @param state as bool
+ """
+ action.set_state(state)
+ if state:
+ self.__track.set_loved(self.__track.loved | LovedFlags.SKIPPED)
+ else:
+ self.__track.set_loved(self.__track.loved & ~LovedFlags.SKIPPED)
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_playlist.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_playlist.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_playlist.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_playlist.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_playlists.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_playlists.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_playlists.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_playlists.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_search.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_search.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_search.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_search.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_selectionlist.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_selectionlist.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_selectionlist.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_selectionlist.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_similars.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_similars.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_similars.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_similars.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_suggestions.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_suggestions.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_suggestions.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_suggestions.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_sync.py lollypop-1.4.16.r6.ga09712088/lollypop/menu_sync.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/menu_sync.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/menu_sync.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/miniplayer.py lollypop-1.4.16.r6.ga09712088/lollypop/miniplayer.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/miniplayer.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/miniplayer.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/mpris.py lollypop-1.4.16.r6.ga09712088/lollypop/mpris.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/mpris.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/mpris.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# Copyright (c) 2016 Gaurav Narula
# Copyright (c) 2016 Felipe Borges
# Copyright (c) 2013 Arnel A. Borja
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/notification.py lollypop-1.4.16.r6.ga09712088/lollypop/notification.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/notification.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/notification.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/objects_album.py lollypop-1.4.16.r6.ga09712088/lollypop/objects_album.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/objects_album.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/objects_album.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# Copyright (c) 2015 Jean-Philippe Braun
# 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
@@ -13,7 +13,7 @@
from hashlib import md5
-from lollypop.define import App, StorageType, ScanUpdate
+from lollypop.define import App, StorageType, ScanUpdate, Type
from lollypop.objects_track import Track
from lollypop.objects import Base
from lollypop.utils import emit_signal
@@ -140,6 +140,7 @@
self.__name = None
self.__skipped = skipped
self.__disc_number = None
+ self.__original_year = Type.NONE
self.__tracks_storage_type = self.storage_type
# Use artist ids from db else
if artist_ids:
@@ -176,15 +177,9 @@
Set album disc
@param disc_number as int
"""
+ self.__original_year = Type.NONE
self.__disc_number = disc_number
- def set_year(self, year):
- """
- Set album year to value
- @param year as int
- """
- self._year = year
-
def set_tracks(self, tracks, clone=True):
"""
Set album tracks, do not disable clone if you know self is already
@@ -355,7 +350,8 @@
@return album
"""
album = Album(self.id, self.genre_ids, self.artist_ids, skipped)
- album.set_tracks(self.tracks)
+ if skipped:
+ album.set_tracks(self.tracks)
return album
def set_storage_type(self, storage_type):
@@ -371,6 +367,28 @@
"""
self.__skipped = True
+ def merge_discs(self):
+ """
+ Merge album discs
+ @return Disc
+ """
+ self.__original_year = None
+ tracks = self.tracks
+ disc = Disc(self, 0, self.__tracks_storage_type, self.__skipped)
+ disc.set_tracks(tracks)
+ self.__discs = [disc]
+
+ @property
+ def original_year(self):
+ """
+ Get disc original year
+ @return int/None
+ """
+ if self.__original_year == Type.NONE:
+ self.__original_year = App().tracks.get_year_for_album(
+ self.id, self.__disc_number)
+ return self.__original_year
+
@property
def collection_item(self):
"""
@@ -458,16 +476,6 @@
self.__tracks = tracks
return tracks
- def merge_discs(self):
- """
- Merge album discs
- @return Disc
- """
- tracks = self.tracks
- disc = Disc(self, 0, self.__tracks_storage_type, self.__skipped)
- disc.set_tracks(tracks)
- self.__discs = [disc]
-
@property
def discs(self):
"""
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/objects.py lollypop-1.4.16.r6.ga09712088/lollypop/objects.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/objects.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/objects.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# Copyright (c) 2015 Jean-Philippe Braun
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/objects_track.py lollypop-1.4.16.r6.ga09712088/lollypop/objects_track.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/objects_track.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/objects_track.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# Copyright (c) 2015 Jean-Philippe Braun
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/player_albums.py lollypop-1.4.16.r6.ga09712088/lollypop/player_albums.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/player_albums.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/player_albums.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/player_auto_random.py lollypop-1.4.16.r6.ga09712088/lollypop/player_auto_random.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/player_auto_random.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/player_auto_random.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# Copyright (c) 2020 David Mandelberg
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/player_auto_similar.py lollypop-1.4.16.r6.ga09712088/lollypop/player_auto_similar.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/player_auto_similar.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/player_auto_similar.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/player_bin.py lollypop-1.4.16.r6.ga09712088/lollypop/player_bin.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/player_bin.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/player_bin.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/player_linear.py lollypop-1.4.16.r6.ga09712088/lollypop/player_linear.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/player_linear.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/player_linear.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/player_plugins.py lollypop-1.4.16.r6.ga09712088/lollypop/player_plugins.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/player_plugins.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/player_plugins.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# Copyright (C) 2010 Jonathan Matthew (replay gain code)
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/player.py lollypop-1.4.16.r6.ga09712088/lollypop/player.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/player.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/player.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/player_queue.py lollypop-1.4.16.r6.ga09712088/lollypop/player_queue.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/player_queue.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/player_queue.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/player_shuffle.py lollypop-1.4.16.r6.ga09712088/lollypop/player_shuffle.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/player_shuffle.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/player_shuffle.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/player_transitions.py lollypop-1.4.16.r6.ga09712088/lollypop/player_transitions.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/player_transitions.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/player_transitions.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/playlists.py lollypop-1.4.16.r6.ga09712088/lollypop/playlists.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/playlists.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/playlists.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -412,6 +412,7 @@
"sync-internal-ids").get_string()
try:
data = json.loads(internal_ids)
+ data.keys()
except:
data = {}
synced_ids = []
@@ -439,6 +440,7 @@
"sync-internal-ids").get_string()
try:
data = json.loads(internal_ids)
+ data.keys()
except:
data = {}
synced_ids = []
@@ -494,6 +496,7 @@
"sync-internal-ids").get_string()
try:
data = json.loads(internal_ids)
+ data.keys()
except:
data = {}
data[str(playlist_id)] = synced
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/pop_devices.py lollypop-1.4.16.r6.ga09712088/lollypop/pop_devices.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/pop_devices.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/pop_devices.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/pop_information.py lollypop-1.4.16.r6.ga09712088/lollypop/pop_information.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/pop_information.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/pop_information.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/progressbar.py lollypop-1.4.16.r6.ga09712088/lollypop/progressbar.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/progressbar.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/progressbar.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/search_local.py lollypop-1.4.16.r6.ga09712088/lollypop/search_local.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/search_local.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/search_local.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/search.py lollypop-1.4.16.r6.ga09712088/lollypop/search.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/search.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/search.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/selectionlist.py lollypop-1.4.16.r6.ga09712088/lollypop/selectionlist.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/selectionlist.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/selectionlist.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -243,9 +243,6 @@
emit_signal(self, "populated")
-# TODO: There is no reason today to share a common class for sidebar and lists
-# Code cleanup needed, will simplify things!
-# Historical because previously, sidebar was a sidebar + a list
class SelectionList(LazyLoadingView, GesturesHelper):
"""
A list for artists/genres
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/settings.py lollypop-1.4.16.r6.ga09712088/lollypop/settings.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/settings.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/settings.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/shown.py lollypop-1.4.16.r6.ga09712088/lollypop/shown.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/shown.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/shown.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/similars_deezer.py lollypop-1.4.16.r6.ga09712088/lollypop/similars_deezer.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/similars_deezer.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/similars_deezer.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/similars_lastfm.py lollypop-1.4.16.r6.ga09712088/lollypop/similars_lastfm.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/similars_lastfm.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/similars_lastfm.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/similars_local.py lollypop-1.4.16.r6.ga09712088/lollypop/similars_local.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/similars_local.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/similars_local.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/similars.py lollypop-1.4.16.r6.ga09712088/lollypop/similars.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/similars.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/similars.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/similars_spotify.py lollypop-1.4.16.r6.ga09712088/lollypop/similars_spotify.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/similars_spotify.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/similars_spotify.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/sync_mtp.py lollypop-1.4.16.r6.ga09712088/lollypop/sync_mtp.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/sync_mtp.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/sync_mtp.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -91,6 +91,7 @@
stream.get_output_stream().write_all(jsondb.encode("utf-8"))
tmpfile.copy(dbfile, Gio.FileCopyFlags.OVERWRITE, None, None)
stream.close()
+ tmpfile.delete(None)
except Exception as e:
Logger.error("MtpSyncDb::__save(): %s", e)
@@ -247,7 +248,7 @@
album_ids = App().albums.get_synced_ids(0)
album_ids += App().albums.get_synced_ids(index)
for album_id in album_ids:
- album = Album(album_id)
+ album = Album(album_id, skipped=False)
tracks += album.tracks
# New tracks for playlists
playlist_ids = App().playlists.get_synced_ids(0)
@@ -294,7 +295,7 @@
emit_signal(self, "sync-progress",
self.__done / self.__total + 2)
except Exception as e:
- Logger.error("MtpSync::__sync(): %s" % e)
+ Logger.error("MtpSync::sync(): %s" % e)
finally:
Logger.info("Save sync db")
if not self.__cancellable.is_cancelled():
@@ -524,8 +525,8 @@
Logger.debug("MtpSync::__copy_file(): %s -> %s"
% (src_uri, dst_uri))
if convertion_needed:
- convert_uri = "file:///tmp/lollypop_convert"
- convert_file = Gio.File.new_for_uri(convert_uri)
+ path = "{}/lollypop_convert".format(GLib.get_tmp_dir())
+ convert_file = Gio.File.new_for_path(path)
pipeline = self.__convert(src, convert_file)
# Check if encoding is finished
if pipeline is not None:
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/tag_frame_lang.py lollypop-1.4.16.r6.ga09712088/lollypop/tag_frame_lang.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/tag_frame_lang.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/tag_frame_lang.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/tag_frame.py lollypop-1.4.16.r6.ga09712088/lollypop/tag_frame.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/tag_frame.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/tag_frame.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/tag_frame_text.py lollypop-1.4.16.r6.ga09712088/lollypop/tag_frame_text.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/tag_frame_text.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/tag_frame_text.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/tagreader.py lollypop-1.4.16.r6.ga09712088/lollypop/tagreader.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/tagreader.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/tagreader.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -32,12 +32,7 @@
"""
Init tag reader
"""
- self.init_discoverer()
- def init_discoverer(self):
- """
- Init discover
- """
self._discoverer = GstPbutils.Discoverer.new(10 * Gst.SECOND)
def get_info(self, uri):
@@ -56,6 +51,15 @@
Scanner tag reader
"""
+ __STRING = ["title", "artist", "composer", "conductor",
+ "musicbrainz-albumid", "musicbrainz-trackid",
+ "musicbrainz-artistid", "musicbrainz-albumartistid",
+ "version", "performer", "artist-sortname",
+ "album-artist-sortname", "interpreted-by", "album-artist",
+ "album", "genre", "lyrics", "publisher"]
+ __INT = ["album-disc-number", "track-number"]
+ __DOUBLE = ["beats-per-minute"]
+
def __init__(self):
"""
Init tag reader
@@ -71,9 +75,8 @@
"""
if tags is None:
return GLib.path_get_basename(filepath)
- (exists, title) = tags.get_string_index("title", 0)
- # We need to check tag is not just spaces
- if not exists or not title.strip(" "):
+ title = self.__get(tags, ["title"])
+ if not title:
title = GLib.path_get_basename(filepath)
return title
@@ -85,13 +88,7 @@
"""
if tags is None:
return _("Unknown")
- artists = []
- for i in range(tags.get_tag_size("artist")):
- (exists, read) = tags.get_string_index("artist", i)
- # We need to check tag is not just spaces
- if exists and read.strip(" "):
- artists.append(read)
- return "; ".join(artists)
+ return self.__get(tags, ["artist"])
def get_composers(self, tags):
"""
@@ -101,13 +98,7 @@
"""
if tags is None:
return _("Unknown")
- composers = []
- for i in range(tags.get_tag_size("composer")):
- (exists, read) = tags.get_string_index("composer", i)
- # We need to check tag is not just spaces
- if exists and read.strip(" "):
- composers.append(read)
- return "; ".join(composers)
+ return self.__get(tags, ["composer"])
def get_conductors(self, tags):
"""
@@ -117,13 +108,7 @@
"""
if tags is None:
return _("Unknown")
- conductors = []
- for i in range(tags.get_tag_size("conductor")):
- (exists, read) = tags.get_string_index("conductor", i)
- # We need to check tag is not just spaces
- if exists and read.strip(" "):
- conductors.append(read)
- return "; ".join(conductors)
+ return self.__get(tags, ["conductor"])
def get_mb_id(self, tags, name):
"""
@@ -134,8 +119,7 @@
"""
if tags is None or not name:
return ""
- (exists, mbid) = tags.get_string_index("musicbrainz-" + name, 0)
- return mbid or ""
+ return self.__get(tags, ["musicbrainz-" + name])
def get_mb_album_id(self, tags):
"""
@@ -177,8 +161,7 @@
"""
if tags is None:
return ""
- (exists, version) = tags.get_string_index("version", 0)
- return version or ""
+ return self.__get(tags, ["version"])
def get_performers(self, tags):
"""
@@ -188,13 +171,7 @@
"""
if tags is None:
return _("Unknown")
- performers = []
- for i in range(tags.get_tag_size("performer")):
- (exists, read) = tags.get_string_index("performer", i)
- # We need to check tag is not just spaces
- if exists and read.strip(" "):
- performers.append(read)
- return "; ".join(performers)
+ return self.__get(tags, ["performer"])
def get_artist_sortnames(self, tags):
"""
@@ -204,13 +181,7 @@
"""
if tags is None:
return ""
- sortnames = []
- for i in range(tags.get_tag_size("artist-sortname")):
- (exists, read) = tags.get_string_index("artist-sortname", i)
- # We need to check tag is not just spaces
- if exists and read.strip(" "):
- sortnames.append(read)
- return "; ".join(sortnames)
+ return self.__get(tags, ["artist-sortname"])
def get_album_artist_sortnames(self, tags):
"""
@@ -220,13 +191,7 @@
"""
if tags is None:
return ""
- sortnames = []
- for i in range(tags.get_tag_size("album-artist-sortname")):
- (exists, read) = tags.get_string_index("album-artist-sortname", i)
- # We need to check tag is not just spaces
- if exists and read.strip(" "):
- sortnames.append(read)
- return "; ".join(sortnames)
+ return self.__get(tags, ["album-artist-sortname"])
def get_remixers(self, tags):
"""
@@ -236,19 +201,10 @@
"""
if tags is None:
return _("Unknown")
- remixers = []
- for i in range(tags.get_tag_size("interpreted-by")):
- (exists, read) = tags.get_string_index("interpreted-by", i)
- # We need to check tag is not just spaces
- if exists and read.strip(" "):
- remixers.append(read)
+ remixers = self.__get(tags, ["interpreted-by"])
if not remixers:
- for i in range(tags.get_tag_size("extended-comment")):
- (exists, read) = tags.get_string_index("extended-comment", i)
- if exists and read.startswith("REMIXER="):
- remixer = read[8:]
- remixers.append(remixer)
- return "; ".join(remixers)
+ remixers = self.__get_extended(tags, ["REMIXER"])
+ return remixers
def get_album_artists(self, tags):
"""
@@ -258,13 +214,7 @@
"""
if tags is None:
return _("Unknown")
- artists = []
- for i in range(tags.get_tag_size("album-artist")):
- (exists, read) = tags.get_string_index("album-artist", i)
- # We need to check tag is not just spaces
- if exists and read.strip(" "):
- artists.append(read)
- return "; ".join(artists)
+ return self.__get(tags, ["album-artist"])
def get_album_name(self, tags):
"""
@@ -274,11 +224,10 @@
"""
if tags is None:
return _("Unknown")
- (exists, album_name) = tags.get_string_index("album", 0)
- # We need to check tag is not just spaces
- if not exists or not album_name.strip(" "):
- album_name = _("Unknown")
- return album_name
+ album = self.__get(tags, ["album"])
+ if not album:
+ album = _("Unknown")
+ return album
def get_genres(self, tags):
"""
@@ -288,15 +237,10 @@
"""
if tags is None:
return _("Unknown")
- genres = []
- for i in range(tags.get_tag_size("genre")):
- (exists, read) = tags.get_string_index("genre", i)
- # We need to check tag is not just spaces
- if exists and read.strip(" "):
- genres.append(read)
+ genres = self.__get(tags, ["genre"])
if not genres:
- return _("Unknown")
- return "; ".join(genres)
+ genres = _("Unknown")
+ return genres
def get_discname(self, tags):
"""
@@ -304,18 +248,7 @@
@param tags as Gst.TagList
@return disc name as str
"""
- if tags is None:
- return ""
- discname = ""
- for i in range(tags.get_tag_size("extended-comment")):
- (exists, read) = tags.get_string_index("extended-comment", i)
- if exists and read.startswith("PART"):
- discname = "=".join(read.split("=")[1:])
- break
- if exists and read.startswith("DISCSUBTITLE"):
- discname = "=".join(read.split("=")[1:])
- break
- return discname
+ return self.__get_extended(tags, ['PART', 'DISCSUBTITLE'])
def get_discnumber(self, tags):
"""
@@ -325,8 +258,8 @@
"""
if tags is None:
return 0
- (exists, discnumber) = tags.get_uint_index("album-disc-number", 0)
- if not exists:
+ discnumber = self.__get(tags, ["album-disc-number"])
+ if not discnumber:
discnumber = 0
return discnumber
@@ -338,35 +271,14 @@
"""
if tags is None:
return False
- size = tags.get_tag_size("private-id3v2-frame")
- for i in range(0, size):
- (exists, sample) = tags.get_sample_index(
- "private-id3v2-frame",
- i)
- if not exists:
- continue
- (exists, m) = sample.get_buffer().map(Gst.MapFlags.READ)
- if not exists:
- continue
- # Gstreamer 1.18 API breakage
- try:
- bytes = m.data.tobytes()
- except:
- bytes = m.data
- frame = FrameTextTag(bytes)
- if frame.key == "TCMP":
- string = frame.string
- if not string:
- Logger.debug(tags.to_string())
- return string and string[-1] == "1"
- size = tags.get_tag_size("extended-comment")
- for i in range(0, size):
- (exists, sample) = tags.get_string_index(
- "extended-comment",
- i)
- if not exists or not sample.startswith("COMPILATION="):
- continue
- return sample[12]
+ try:
+ compilation = self.__get_private_string(tags, "TCMP", False)
+ if not compilation:
+ compilation = self.__get_extended(tags, ["COMPILATION"])
+ if compilation:
+ return bool(compilation)
+ except Exception as e:
+ Logger.error("TagReader::get_compilation(): %s" % e)
return False
def get_tracknumber(self, tags, filename):
@@ -377,10 +289,10 @@
@return track number as int
"""
if tags is not None:
- (exists, tracknumber) = tags.get_uint_index("track-number", 0)
+ tracknumber = self.__get(tags, ["track-number"])
else:
- (exists, tracknumber) = (False, 0)
- if not exists:
+ tracknumber = None
+ if not tracknumber:
# Guess from filename
m = match("^([0-9]*)[ ]*-", filename)
if m:
@@ -436,45 +348,21 @@
@return year and timestamp (int, int)
"""
def get_id3():
+ date_string = self.__get_private_string(tags, "TDOR", False)
try:
- size = tags.get_tag_size("private-id3v2-frame")
- for i in range(0, size):
- (exists, sample) = tags.get_sample_index(
- "private-id3v2-frame",
- i)
- if not exists:
- continue
- (exists, m) = sample.get_buffer().map(Gst.MapFlags.READ)
- if not exists:
- continue
- # Gstreamer 1.18 API breakage
- try:
- bytes = m.data.tobytes()
- except:
- bytes = m.data
- frame = FrameTextTag(bytes)
- if frame.key == "TDOR":
- if not frame.string:
- Logger.debug(tags.to_string())
- date = get_iso_date_from_string(frame.string)
- datetime = GLib.DateTime.new_from_iso8601(date, None)
- return (datetime.get_year(), datetime.to_unix())
+ date = get_iso_date_from_string(date_string)
+ datetime = GLib.DateTime.new_from_iso8601(date, None)
+ return (datetime.get_year(), datetime.to_unix())
except:
pass
return (None, None)
def get_ogg():
try:
- size = tags.get_tag_size("extended-comment")
- for i in range(0, size):
- (exists, sample) = tags.get_string_index(
- "extended-comment",
- i)
- if not exists or not sample.startswith("ORIGINALDATE="):
- continue
- date = get_iso_date_from_string(sample[13:])
- datetime = GLib.DateTime.new_from_iso8601(date, None)
- return (datetime.get_year(), datetime.to_unix())
+ date_string = self.__get_extended(tags, ['ORIGINALDATE'])
+ date = get_iso_date_from_string(date_string)
+ datetime = GLib.DateTime.new_from_iso8601(date, None)
+ return (datetime.get_year(), datetime.to_unix())
except:
pass
return (None, None)
@@ -492,14 +380,10 @@
@param tags as Gst.TagList
@return int/None
"""
- try:
- if tags is not None:
- (exists, bpm) = tags.get_double_index("beats-per-minute", 0)
- if exists:
- return bpm
- except:
- pass
- return None
+ bpm = self.__get(tags, ["beats-per-minute"])
+ if not bpm:
+ bpm = None
+ return bpm
def get_popm(self, tags):
"""
@@ -524,57 +408,21 @@
bytes = m.data.tobytes()
except:
bytes = m.data
- if bytes[0:4] == b"POPM":
- # Get tag
- """
- Location of rating for common media players:
- - Plain POPM is located in bytes[11]
- - Media Monkey is located in bytes[19] and
- we are searching bytes[10:40] for "no@email"
- - WinAMP is located in bytes[28] and we are searching
- bytes[10:40] for "rating@winamp.com"
- - Windows Media Player is located in bytes[40] and
- we are searching bytes[10:40] for
- "Windows Media Player 9 Series"
- - MusicBee is located in bytes[19] and
- we are searching bytes[10:40] for
- "MusicBee"
- """
- if bytes.find(b"Windows Media Player 9 Series") >= 0:
- location = 40
- Logger.debug(
- "Rating type: Windows Media Player Location:"
- " %s Rating: %s", location, bytes[location])
- elif bytes.find(b"rating@winamp.com") >= 0:
- location = 28
- Logger.debug(
- "Rating type: WinAMP Location: %s Rating: %s",
- location, bytes[location])
- elif bytes.find(b"no@email") >= 0:
- location = 19
- Logger.debug(
- "Rating type: MediaMonkey Location: %s Rating: %s",
- location, bytes[location])
- elif bytes.find(b"MusicBee") >= 0:
- location = 19
- Logger.debug(
- "Rating type: MusicBee Location: %s Rating: %s",
- location, bytes[location])
- else:
- location = 11
- Logger.debug(
- "Rating type: none Location: %s Rating: %s",
- location, bytes[location])
- popm = bytes[location]
+
+ if len(bytes) > 4 and bytes[0:4] == b"POPM":
+ try:
+ popm = bytes.split(b"\x00")[6][0]
+ except:
+ popm = 0
if popm == 0:
value = 0
- elif popm == 1:
+ elif popm >= 1 and popm < 64:
value = 1
- elif popm == 64:
+ elif popm >= 64 and popm < 128:
value = 2
- elif popm == 128:
+ elif popm >= 128 and popm < 196:
value = 3
- elif popm == 196:
+ elif popm >= 196 and popm < 255:
value = 4
elif popm == 255:
value = 5
@@ -591,61 +439,14 @@
@parma tags as Gst.TagList
@return lyrics as str
"""
- def decode_lyrics(bytes):
- try:
- frame = FrameLangTag(bytes)
- if frame.key == "USLT":
- return frame.string
- except Exception as e:
- Logger.warning("TagReader::get_lyrics(): %s", e)
- return None
-
def get_mp4():
- try:
- (exists, sample) = tags.get_string_index("lyrics", 0)
- if exists:
- return sample
- except Exception as e:
- Logger.error("TagReader::get_mp4(): %s" % e)
- return ""
+ return self.__get(tags, ["lyrics"])
def get_id3():
- try:
- size = tags.get_tag_size("private-id3v2-frame")
- for i in range(0, size):
- (exists, sample) = tags.get_sample_index(
- "private-id3v2-frame",
- i)
- if not exists:
- continue
- (exists, m) = sample.get_buffer().map(Gst.MapFlags.READ)
- if not exists:
- continue
- # Gstreamer 1.18 API breakage
- try:
- bytes = m.data.tobytes()
- except:
- bytes = m.data
- string = decode_lyrics(bytes)
- if string is not None:
- return string
- except Exception as e:
- Logger.error("TagReader::get_id3(): %s" % e)
- return ""
+ return self.__get_private_string(tags, "USLT", True)
def get_ogg():
- try:
- size = tags.get_tag_size("extended-comment")
- for i in range(0, size):
- (exists, sample) = tags.get_string_index(
- "extended-comment",
- i)
- if not exists or not sample.startswith("LYRICS="):
- continue
- return sample[7:]
- except Exception as e:
- Logger.error("TagReader::get_ogg(): %s" % e)
- return ""
+ return self.__get_extended(tags, ["LYRICS"])
if tags is None:
return ""
@@ -671,36 +472,21 @@
lyrics.append((decodeUnicode(l, encoding),
int.from_bytes(t[1:4], "big")))
except Exception as e:
- Logger.warning("TagReader::get_synced_lyrics1(): %s", e)
+ Logger.warning(
+ "TagReader::get_synced_lyrics.decode_lyrics(): %s", e)
return lyrics
def get_id3():
try:
- size = tags.get_tag_size("private-id3v2-frame")
- for i in range(0, size):
- (exists, sample) = tags.get_sample_index(
- "private-id3v2-frame",
- i)
- if not exists:
- continue
- (exists, m) = sample.get_buffer().map(Gst.MapFlags.READ)
- if not exists:
- continue
- # Gstreamer 1.18 API breakage
- try:
- bytes = m.data.tobytes()
- except:
- bytes = m.data
- prefix = (bytes[0:4])
- if prefix not in [b"SYLT"]:
- continue
- frame = bytes[10:]
+ b = self.__get_private_bytes(tags, "SYLT")
+ if b:
+ frame = b[10:]
encoding = frame[0:1]
string = decode_lyrics(frame.split(b"\n"), encoding)
if string is not None:
return string
except Exception as e:
- Logger.error("TagReader::get_synced_lyrics2(): %s" % e)
+ Logger.warning("TagReader::get_synced_lyrics.get_id3(): %s", e)
return ""
if tags is None:
@@ -824,3 +610,106 @@
#######################
# PRIVATE #
#######################
+ def __get_extended(self, tags, keys):
+ """
+ Return tag from tags following keys
+ @param tags as Gst.TagList
+ @param keys as [str]
+ @return Tag as str
+ """
+ if tags is None:
+ return ""
+ items = []
+ try:
+ for i in range(tags.get_tag_size("extended-comment")):
+ (exists, read) = tags.get_string_index("extended-comment", i)
+ for key in keys:
+ if exists and read.startswith(key + "="):
+ items.append("".join(read.split("=")[1:]))
+ except Exception as e:
+ Logger.error("TagReader::__get_extended(): %s", e)
+ return ";".join(items)
+
+ def __get(self, tags, keys):
+ """
+ Return tag from tags following keys
+ Only handles string/uint/double
+ @param tags as Gst.TagList
+ @param keys as [str]
+ @return Tag as str/int/double. Empty string if does not exist
+ """
+ if tags is None:
+ return ""
+ items = []
+ try:
+ for key in keys:
+ for i in range(tags.get_tag_size(key)):
+ if key in self.__STRING:
+ (exists, read) = tags.get_string_index(key, i)
+ if exists and read.strip(" "):
+ items.append(read)
+ elif key in self.__INT:
+ (exists, read) = tags.get_uint_index(key, i)
+ if exists:
+ return read
+ elif key in self.__DOUBLE:
+ (exists, read) = tags.get_double_index(key, i)
+ if exists:
+ return read
+ else:
+ Logger.error("Missing key" % key)
+ except Exception as e:
+ Logger.error("TagReader::__get(): %s", e)
+ return ";".join(items)
+
+ def __get_private_bytes(self, tags, key):
+ """
+ Get key from private frame
+ @param tags as Gst.TagList
+ @param key as str
+ @return frame as bytes
+ """
+ try:
+ size = tags.get_tag_size("private-id3v2-frame")
+ encoded_key = key.encode("utf-8")
+ for i in range(0, size):
+ (exists, sample) = tags.get_sample_index(
+ "private-id3v2-frame",
+ i)
+ if not exists:
+ continue
+ (exists, m) = sample.get_buffer().map(Gst.MapFlags.READ)
+ if not exists:
+ continue
+ # Gstreamer 1.18 API breakage
+ try:
+ b = m.data.tobytes()
+ except:
+ b = m.data
+
+ if b[0:len(encoded_key)] != encoded_key:
+ continue
+ return b
+ except Exception as e:
+ Logger.error("TagReader::__get_private_bytes(): %s" % e)
+ return b""
+
+ def __get_private_string(self, tags, key, lang):
+ """
+ Get key from private frame
+ @param tags as Gst.TagList
+ @param key as str
+ @param lang as bool
+ @return Tag as str
+ """
+ try:
+ b = self.__get_private_bytes(tags, key)
+ if lang:
+ frame = FrameLangTag(b)
+ else:
+ frame = FrameTextTag(b)
+ if frame.key == key:
+ return frame.string
+ except Exception as e:
+ Logger.error("TagReader::__get_private(): %s" % e)
+ return ""
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/toolbar_end.py lollypop-1.4.16.r6.ga09712088/lollypop/toolbar_end.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/toolbar_end.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/toolbar_end.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/toolbar_info.py lollypop-1.4.16.r6.ga09712088/lollypop/toolbar_info.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/toolbar_info.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/toolbar_info.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/toolbar_playback.py lollypop-1.4.16.r6.ga09712088/lollypop/toolbar_playback.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/toolbar_playback.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/toolbar_playback.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/toolbar.py lollypop-1.4.16.r6.ga09712088/lollypop/toolbar.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/toolbar.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/toolbar.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -10,7 +10,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-from gi.repository import Gtk, GLib, Handy
+from gi.repository import GLib, Handy
from lollypop.define import App, Size
from lollypop.toolbar_playback import ToolbarPlayback
@@ -33,7 +33,7 @@
Init toolbar
@param window as Window
"""
- Gtk.HeaderBar.__init__(self)
+ Handy.HeaderBar.__init__(self)
SizeAllocationHelper.__init__(self)
self.__width = Size.MINI
self.__timeout_id = None
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/toolbar_title.py lollypop-1.4.16.r6.ga09712088/lollypop/toolbar_title.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/toolbar_title.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/toolbar_title.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/utils_album.py lollypop-1.4.16.r6.ga09712088/lollypop/utils_album.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/utils_album.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/utils_album.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/utils_artist.py lollypop-1.4.16.r6.ga09712088/lollypop/utils_artist.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/utils_artist.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/utils_artist.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/utils_file.py lollypop-1.4.16.r6.ga09712088/lollypop/utils_file.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/utils_file.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/utils_file.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/utils.py lollypop-1.4.16.r6.ga09712088/lollypop/utils.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/utils.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/utils.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde
+# Copyright (c) 2014-2021 Cedric Bellegarde
# 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
@@ -253,13 +253,18 @@
c.isdigit() or c in ignore]).rstrip()
-def get_lollypop_album_id(name, artists):
+def get_lollypop_album_id(name, artists, year=None):
"""
Calculate Lollypop album id
@param name as str
@param artists as [str]
+ @param year as int/None
"""
- name = "%s_%s" % (sql_escape(" ".join(artists)), sql_escape(name))
+ if year is None:
+ name = "%s_%s" % (sql_escape(" ".join(artists)), sql_escape(name))
+ else:
+ name = "%s_%s_%s" % (
+ sql_escape(" ".join(artists)), sql_escape(name), year)
return md5(name.encode("utf-8")).hexdigest()
diff -Nru lollypop-1.4.7.r90.g765cf1b3/lollypop/view_album.py lollypop-1.4.16.r6.ga09712088/lollypop/view_album.py
--- lollypop-1.4.7.r90.g765cf1b3/lollypop/view_album.py 2020-12-28 23:00:11.000000000 +0000
+++ lollypop-1.4.16.r6.ga09712088/lollypop/view_album.py 2021-02-25 23:00:18.000000000 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2020 Cedric Bellegarde