Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package sacad for openSUSE:Factory checked 
in at 2023-03-06 18:55:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/sacad (Old)
 and      /work/SRC/openSUSE:Factory/.sacad.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "sacad"

Mon Mar  6 18:55:37 2023 rev:10 rq:1069537 version:2.7.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/sacad/sacad.changes      2023-01-03 
15:05:23.622519788 +0100
+++ /work/SRC/openSUSE:Factory/.sacad.new.31432/sacad.changes   2023-03-06 
18:55:44.964725341 +0100
@@ -1,0 +2,8 @@
+Mon Feb 27 21:50:29 UTC 2023 - Dirk Müller <[email protected]>
+
+- update to 2.7.4:
+  * crunch using oxipng if available
+  * improve FLAC cover tag compatibility
+  * update UA to fix Amazon sources 503 errors
+
+-------------------------------------------------------------------

Old:
----
  sacad-2.7.3.tar.gz

New:
----
  sacad-2.7.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sacad.spec ++++++
--- /var/tmp/diff_new_pack.XGZwab/_old  2023-03-06 18:55:45.584728505 +0100
+++ /var/tmp/diff_new_pack.XGZwab/_new  2023-03-06 18:55:45.592728545 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           sacad
-Version:        2.7.3
+Version:        2.7.4
 Release:        0
 Summary:        Search and download music album covers
 License:        MPL-2.0

++++++ sacad-2.7.3.tar.gz -> sacad-2.7.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sacad-2.7.3/README.md new/sacad-2.7.4/README.md
--- old/sacad-2.7.3/README.md   2022-12-17 15:30:11.000000000 +0100
+++ new/sacad-2.7.4/README.md   2023-02-19 14:32:27.000000000 +0100
@@ -29,7 +29,7 @@
   - Last.fm
   - Itunes
 - Smart sorting algorithm to select THE best cover for a given query, using 
several factors: source reliability, image format, image size, image similarity 
with reference cover, etc.
-- Automatically crunch images with optipng or jpegoptim (can save 30% of 
filesize without any loss of quality, great for portable players)
+- Automatically crunch images with optipng, oxipng or jpegoptim (can save 30% 
of filesize without any loss of quality, great for portable players)
 - Cache search results locally for faster future search
 - Do everything to avoid getting blocked by the sources: hide user-agent and 
automatically take care of rate limiting
 - Automatically convert/resize image if needed
@@ -72,12 +72,12 @@
 
 Additionally, if you want to benefit from image crunching (lossless 
recompression to save additional space):
 
-- Install [optipng](http://optipng.sourceforge.net/)
+- Install [oxipng](https://github.com/shssoichiro/oxipng) or 
[optipng](http://optipng.sourceforge.net/)
 - Install [jpegoptim](http://freecode.com/projects/jpegoptim)
 
-On Ubuntu and other Debian derivatives, you can install both with `sudo 
apt-get install optipng jpegoptim`.
+On Ubuntu and other Debian derivatives, you can install them with `sudo 
apt-get install optipng jpegoptim`.
 
-Note that depending of the speed of your CPU, crunching may significantly slow 
down processing as it is very CPU intensive (especially for PNG files).
+Note that depending of the speed of your CPU, crunching may significantly slow 
down processing as it is very CPU intensive (especially with optipng).
 
 ## Command line usage
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sacad-2.7.3/sacad/__init__.py 
new/sacad-2.7.4/sacad/__init__.py
--- old/sacad-2.7.3/sacad/__init__.py   2022-12-17 15:30:11.000000000 +0100
+++ new/sacad-2.7.4/sacad/__init__.py   2023-02-19 14:32:27.000000000 +0100
@@ -2,7 +2,7 @@
 
 """ Smart Automatic Cover Art Downloader : search and download music album 
covers. """
 
-__version__ = "2.7.3"
+__version__ = "2.7.4"
 __author__ = "desbma"
 __license__ = "MPL 2.0"
 
@@ -15,7 +15,14 @@
 from typing import Any, Optional, Sequence
 
 from sacad import colored_logging, sources
-from sacad.cover import HAS_JPEGOPTIM, HAS_OPTIPNG, SUPPORTED_IMG_FORMATS, 
CoverImageFormat, CoverSourceResult
+from sacad.cover import (
+    HAS_JPEGOPTIM,
+    HAS_OPTIPNG,
+    HAS_OXIPNG,
+    SUPPORTED_IMG_FORMATS,
+    CoverImageFormat,
+    CoverSourceResult,
+)
 from sacad.sources.base import CoverSource
 
 COVER_SOURCE_CLASSES = {
@@ -198,11 +205,11 @@
     else:
         logging.getLogger("asyncio").setLevel(logging.CRITICAL + 1)
 
-    # display warning if optipng or jpegoptim are missing
+    # display warning if optipng/oxipng or jpegoptim are missing
     if not HAS_JPEGOPTIM:
         logging.getLogger("Main").warning("jpegoptim could not be found, JPEG 
crunching will be disabled")
-    if not HAS_OPTIPNG:
-        logging.getLogger("Main").warning("optipng could not be found, PNG 
crunching will be disabled")
+    if not (HAS_OPTIPNG or HAS_OXIPNG):
+        logging.getLogger("Main").warning("optipng or oxipng could not be 
found, PNG crunching will be disabled")
 
     # search and download
     coroutine = search_and_download(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sacad-2.7.3/sacad/cover.py 
new/sacad-2.7.4/sacad/cover.py
--- old/sacad-2.7.3/sacad/cover.py      2022-12-17 15:30:11.000000000 +0100
+++ new/sacad-2.7.4/sacad/cover.py      2023-02-19 14:32:27.000000000 +0100
@@ -72,6 +72,7 @@
 
 HAS_JPEGOPTIM = shutil.which("jpegoptim") is not None
 HAS_OPTIPNG = shutil.which("optipng") is not None
+HAS_OXIPNG = shutil.which("oxipng") is not None
 SUPPORTED_IMG_FORMATS = {"jpg": CoverImageFormat.JPEG, "jpeg": 
CoverImageFormat.JPEG, "png": CoverImageFormat.PNG}
 FORMAT_EXTENSIONS = {CoverImageFormat.JPEG: "jpg", CoverImageFormat.PNG: "png"}
 
@@ -514,7 +515,7 @@
     @staticmethod
     async def crunch(image_data, format, silent=False):
         """Crunch image data, and return the processed data, or orignal data 
if operation failed."""
-        if ((format is CoverImageFormat.PNG) and (not HAS_OPTIPNG)) or (
+        if ((format is CoverImageFormat.PNG) and (not (HAS_OPTIPNG or 
HAS_OXIPNG))) or (
             (format is CoverImageFormat.JPEG) and (not HAS_JPEGOPTIM)
         ):
             return image_data
@@ -525,7 +526,10 @@
                 tmp_out_file.write(image_data)
             size_before = len(image_data)
             if format is CoverImageFormat.PNG:
-                cmd = ["optipng", "-quiet", "-o1"]
+                if HAS_OXIPNG:
+                    cmd = ["oxipng", "-q", "-s"]
+                else:
+                    cmd = ["optipng", "-quiet", "-o1"]
             elif format is CoverImageFormat.JPEG:
                 cmd = ["jpegoptim", "-q", "--strip-all"]
             cmd.append(tmp_out_filepath)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sacad-2.7.3/sacad/recurse.py 
new/sacad-2.7.4/sacad/recurse.py
--- old/sacad-2.7.3/sacad/recurse.py    2022-12-17 15:30:11.000000000 +0100
+++ new/sacad-2.7.4/sacad/recurse.py    2023-02-19 14:32:27.000000000 +0100
@@ -129,7 +129,10 @@
 
     # album art
     if isinstance(mf.tags, mutagen._vorbis.VComment):
-        has_embedded_cover = "metadata_block_picture" in mf
+        has_embedded_cover = ("metadata_block_picture" in mf) or (
+            isinstance(mf, mutagen.flac.FLAC)
+            and any((p.type == mutagen.id3.PictureType.COVER_FRONT) for p in 
mf.pictures)
+        )
     elif isinstance(mf.tags, mutagen.id3.ID3):
         has_embedded_cover = any(map(operator.methodcaller("startswith", 
"APIC:"), mf.keys()))
     elif isinstance(mf.tags, mutagen.mp4.MP4Tags):
@@ -254,8 +257,11 @@
             picture.data = cover_data
             picture.type = mutagen.id3.PictureType.COVER_FRONT
             picture.mime = "image/jpeg"
-            encoded_data = base64.b64encode(picture.write())
-            mf["metadata_block_picture"] = encoded_data.decode("ascii")
+            if isinstance(mf, mutagen.flac.FLAC):
+                mf.add_picture(picture)
+            else:
+                encoded_data = base64.b64encode(picture.write())
+                mf["metadata_block_picture"] = encoded_data.decode("ascii")
 
         elif isinstance(mf.tags, mutagen.id3.ID3):
             mf.tags.add(mutagen.id3.APIC(mime="image/jpeg", 
type=mutagen.id3.PictureType.COVER_FRONT, data=cover_data))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sacad-2.7.3/sacad/sources/amazonbase.py 
new/sacad-2.7.4/sacad/sources/amazonbase.py
--- old/sacad-2.7.3/sacad/sources/amazonbase.py 2022-12-17 15:30:11.000000000 
+0100
+++ new/sacad-2.7.4/sacad/sources/amazonbase.py 2023-02-19 14:32:27.000000000 
+0100
@@ -25,7 +25,7 @@
     def updateHttpHeaders(self, headers):
         """See CoverSource.updateHttpHeaders."""
         # mimic Firefox headers
-        headers["User-Agent"] = self.ua
+        headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; 
rv:110.0) Gecko/20100101 Firefox/110.0"
         headers["Accept"] = 
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
         headers["Accept-Language"] = "en-US,en;q=0.9"
         headers["DNT"] = "1"

Reply via email to