diff -Nru pithos-1.6.1/data/io.github.Pithos.appdata.xml.in pithos-1.6.2/data/io.github.Pithos.appdata.xml.in --- pithos-1.6.1/data/io.github.Pithos.appdata.xml.in 2023-05-19 17:30:22.000000000 +0000 +++ pithos-1.6.2/data/io.github.Pithos.appdata.xml.in 2024-03-03 23:53:20.000000000 +0000 @@ -9,21 +9,42 @@ CC0-1.0 GPL-3.0+ -

Pithos is a easy to use native Pandora Radio client that is more lightweight than the pandora.com web client and integrates with the desktop.

-

It supports most functionality of pandora.com such as rating songs, creating/managing stations, quickmix, etc. On top of that it has features such as last.fm scrobbling, media keys, notifications, proxies, and mpris support.

+

An easy to use native Pandora Radio client that is more lightweight than the pandora.com web client and integrates with the desktop.

+

It supports most functionality of pandora.com such as rating songs, creating/managing stations, quickmix, etc. On top of that it has many features such as last.fm scrobbling

https://pithos.github.io https://github.com/pithos/pithos/issues https://github.com/pithos/pithos/wiki/Contributing https://goo.gl/StrKkg https://github.com/pithos/pithos/wiki + + #e6d4ff + #644b93 + - - http://i.imgur.com/2U2ce8v.png - Main Window + + https://i.imgur.com/RzMCls4.png + Main Window showing a playlist + + + https://i.imgur.com/5tcEhkp.png + Dialog showing available plugins + + + https://i.imgur.com/NyQ0uZB.png + Dark variant of the main window + + +

This is a small release with a few fixes

+
    +
  • Fix issue where playback would stop after a few songs
  • +
  • Fix album art caches never being deleted
  • +
+
+

This is a small bugfix release

diff -Nru pithos-1.6.1/debian/changelog pithos-1.6.2/debian/changelog --- pithos-1.6.1/debian/changelog 2022-09-29 21:49:19.000000000 +0000 +++ pithos-1.6.2/debian/changelog 2022-09-29 21:49:19.000000000 +0000 @@ -1,4 +1,11 @@ -pithos (1.6.1-0ubuntu20.04) focal; urgency=medium +pithos (1.6.2-0ubuntu20.04) focal; urgency=medium + + * Fix issue where playback would stop after a few songs + * Fix album art caches never being deleted + + -- pandajim (key for lives deb) Tue, 29 Sep 2022 21:49:19 +0000 + +pithos (1.6.1-0ubuntu22.04) jammy; urgency=medium * Fix Python 3.11 (ubuntu 23.04, Fedora 38) support. * Fix very short songs being labeled as ads. diff -Nru pithos-1.6.1/meson.build pithos-1.6.2/meson.build --- pithos-1.6.1/meson.build 2023-05-19 17:30:22.000000000 +0000 +++ pithos-1.6.2/meson.build 2024-03-03 23:53:20.000000000 +0000 @@ -1,5 +1,5 @@ project('pithos', - version: '1.6.1', + version: '1.6.2', meson_version: '>= 0.50.0' ) diff -Nru pithos-1.6.1/pithos/pithos.py pithos-1.6.2/pithos/pithos.py --- pithos-1.6.1/pithos/pithos.py 2023-05-19 17:30:22.000000000 +0000 +++ pithos-1.6.2/pithos/pithos.py 2024-03-03 23:53:20.000000000 +0000 @@ -14,6 +14,7 @@ import contextlib +import hashlib import html import json import logging @@ -22,7 +23,6 @@ import os import sys import time -import tempfile import urllib.error import urllib.parse import urllib.request @@ -61,6 +61,8 @@ ALBUM_ART_SIZE = 96 TEXT_X_PADDING = 12 +# 15 days in seconds to retain album art files. +ART_CACHE_TIME = 1.296e+6 FALLBACK_BLACK = Gdk.RGBA(red=0.0, green=0.0, blue=0.0, alpha=1.0) FALLBACK_WHITE = Gdk.RGBA(red=1.0, green=1.0, blue=1.0, alpha=1.0) @@ -298,7 +300,7 @@ self._query_position = Gst.Query.new_position(Gst.Format.TIME) self._query_buffer = Gst.Query.new_buffering(Gst.Format.PERCENT) - self.player = Gst.ElementFactory.make("playbin", "player") + self.player = Gst.ElementFactory.make("playbin3", "player") self.player.set_property('buffer-duration', 3 * Gst.SECOND) self.rgvolume = Gst.ElementFactory.make("rgvolume", "rgvolume") self.rgvolume.set_property("album-mode", False) @@ -369,8 +371,9 @@ if is_flatpak(): # However in flatpak that path is not readable by the host. tempdir_base = os.path.join(GLib.get_user_cache_dir(), 'tmp') - self.tempdir = tempfile.TemporaryDirectory(prefix='pithos-', dir=tempdir_base) - logging.info("Created temporary directory {}".format(self.tempdir.name)) + self.tempdir = os.path.join(tempdir_base, 'pithos_cache') + os.makedirs(self.tempdir, exist_ok=True) + logging.info("Created temporary directory {}".format(self.tempdir)) except IOError as e: self.tempdir = None logging.warning('Failed to create a temporary directory: {}'.format(e)) @@ -848,6 +851,15 @@ else: self.user_play() + def clear_art_cache(self): + logging.info('Checking for expired art in cache') + timestamp = time.time() + with os.scandir(self.tempdir) as art_list: + for art in art_list: + age = timestamp - art.stat().st_mtime + if age > ART_CACHE_TIME: + os.remove(os.path.join(self.tempdir, art.path)) + def get_playlist(self, start = False): if self.playlist_update_timer_id: GLib.source_remove(self.playlist_update_timer_id) @@ -877,11 +889,16 @@ return (None, None,) + extra file_url = None + song, index = extra if tmpdir: try: - with tempfile.NamedTemporaryFile(prefix='art-', suffix='.jpeg', dir=tmpdir.name, delete=False) as f: - f.write(image) - file_url = urllib.parse.urljoin('file://', urllib.parse.quote(f.name)) + self.clear_art_cache() + filename_hash = hashlib.sha256((song.artist+song.album).encode('utf-8')).hexdigest()+'.jpeg' + cache_file_path = os.path.join(self.tempdir, filename_hash) + file_url = urllib.parse.urljoin('file://', urllib.parse.quote(cache_file_path)) + if not os.path.exists(cache_file_path): + with open(cache_file_path, 'xb') as f: + f.write(image) except IOError: logging.warning("Failed to write art tempfile")