[tracker-miners/sam/remove-flac-vorbis-extractors: 36/36] extract: Remove flac and vorbis extractors



commit 881af8467859ec2b948ba88cfea15ebf750af866
Author: Sam Thursfield <sam afuera me uk>
Date:   Tue Feb 25 14:05:11 2020 +0100

    extract: Remove flac and vorbis extractors
    
    The GStreamer and libav extractors handle these types well, and these
    alternative codepaths were actually unused in most cases.
    
    Closes https://gitlab.gnome.org/GNOME/tracker-miners/issues/50

 meson.build                                        |   4 -
 meson_options.txt                                  |   4 -
 src/tracker-extract/10-flac.rule                   |   5 -
 src/tracker-extract/10-vorbis.rule                 |   5 -
 src/tracker-extract/meson.build                    |   8 -
 src/tracker-extract/tracker-extract-flac.c         | 321 ---------------
 src/tracker-extract/tracker-extract-vorbis.c       | 432 ---------------------
 tests/functional-tests/extractor-generic.py        |   6 -
 tests/functional-tests/meson.build                 |   6 +-
 .../audio/vorbis.expected.json                     |  54 +--
 10 files changed, 23 insertions(+), 822 deletions(-)
---
diff --git a/meson.build b/meson.build
index 89e1e24bb..6a3f9630e 100644
--- a/meson.build
+++ b/meson.build
@@ -55,7 +55,6 @@ avformat = dependency('libavformat', version: '>= 0.8.4', required: false)
 avutil = dependency('libavutil', version: '>= 0.8.4', required: false)
 dbus = dependency('dbus-1', version: '>= 1.3.1')
 exempi = dependency('exempi-2.0', version: '>= 2.1.0', required: get_option('xmp'))
-flac = dependency('flac', version: '>= 1.2.1', required: get_option('flac'))
 gexiv2 = dependency('gexiv2', required: get_option('raw'))
 gio = dependency('gio-2.0', version: '>=' + glib_required)
 gio_unix = dependency('gio-unix-2.0', version: '>=' + glib_required)
@@ -81,7 +80,6 @@ libpng = dependency('libpng', version: '>= 0.89', required: get_option('png'))
 libseccomp = dependency('libseccomp', version: '>= 2.0', required: false)
 libtiff = dependency('libtiff-4', required: get_option('tiff'))
 libxml2 = dependency('libxml-2.0', version: '>= 2.6', required: get_option('xml'))
-libvorbis = dependency('vorbisfile', version: '>= 0.22', required: get_option('vorbis'))
 poppler = dependency('poppler-glib', version: '>= 0.16.0', required: get_option('pdf'))
 totem_plparser = dependency('totem-plparser', required: get_option('playlist'))
 upower = dependency('upower-glib', version: '>= 0.9.0', required: false)
@@ -474,8 +472,6 @@ if have_tracker_extract
     '    Support RAW:                            ' + gexiv2.found().to_string(),
     '    Support TIFF:                           @0@ (xmp: @1@, exif: @2@, iptc: @3@)'.format(
         libtiff.found().to_string(), exempi.found().to_string(), libexif.found().to_string(), 
libiptcdata.found().to_string()),
-    '    Support Vorbis (ogg/etc):               ' + libvorbis.found().to_string(),
-    '    Support Flac:                           ' + flac.found().to_string(),
     '    Support MS & Open Office:               ' + libgsf.found().to_string(),
     '    Support XML / HTML:                     ' + libxml2.found().to_string(),
     '    Support embedded / sidecar XMP:         ' + exempi.found().to_string(),
diff --git a/meson_options.txt b/meson_options.txt
index 19959dc95..8572a4189 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -39,8 +39,6 @@ option('cue', type: 'feature', value: 'auto',
        description: 'Support cue sheet parsing')
 option('exif', type: 'feature', value: 'auto',
        description: 'Support EXIF metadata')
-option('flac', type: 'feature', value: 'auto',
-       description: 'Support extracting metadata from Flac audio')
 option('gif', type: 'feature', value: 'auto',
        description: 'Support extracting metadata from GIF images')
 option('gsf', type: 'feature', value: 'auto',
@@ -61,8 +59,6 @@ option('raw', type: 'feature', value: 'auto',
        description: 'Support extracting metadata from RAW photos')
 option('tiff', type: 'feature', value: 'auto',
        description: 'Support extracting metadata from TIFF images')
-option('vorbis', type: 'feature', value: 'auto',
-       description: 'Support extracting metadata from Vorbis (ogg/etc) files')
 option('xml', type: 'feature', value: 'auto',
        description: 'Support extracting metadata from XML and HTML documents')
 option('xmp', type: 'feature', value: 'auto',
diff --git a/src/tracker-extract/meson.build b/src/tracker-extract/meson.build
index f2e03e8b7..b661654b0 100644
--- a/src/tracker-extract/meson.build
+++ b/src/tracker-extract/meson.build
@@ -25,10 +25,6 @@ if libgsf.found()
   modules += [['extract-oasis', 'tracker-extract-oasis.c', ['10-oasis.rule'], [libgsf, 
tracker_miners_common_dep]]]
 endif
 
-if flac.found()
-  modules += [['extract-flac', 'tracker-extract-flac.c', ['10-flac.rule'], [flac, 
tracker_miners_common_dep]]]
-endif
-
 if gexiv2.found()
   modules += [['extract-raw', 'tracker-extract-raw.c', ['10-raw.rule'], [gexiv2, tracker_miners_common_dep]]]
 endif
@@ -101,10 +97,6 @@ if libtiff.found()
   modules += [['extract-tiff', 'tracker-extract-tiff.c', ['10-tiff.rule'], [libtiff, 
tracker_miners_common_dep]]]
 endif
 
-if libvorbis.found()
-  modules += [['extract-vorbis', 'tracker-extract-vorbis.c', ['10-vorbis.rule'], [libvorbis, 
tracker_miners_common_dep]]]
-endif
-
 if libgxps.found()
   modules += [['extract-xps', 'tracker-extract-xps.c', ['10-xps.rule'], [libgxps, 
tracker_miners_common_dep]]]
 endif
diff --git a/tests/functional-tests/extractor-generic.py b/tests/functional-tests/extractor-generic.py
index 4b4798a9f..aba28d043 100755
--- a/tests/functional-tests/extractor-generic.py
+++ b/tests/functional-tests/extractor-generic.py
@@ -65,12 +65,6 @@ class GenericExtractionTestCase(fixtures.TrackerExtractTestCase):
         # So we set that variable to our new name
         self._testMethodName = methodName
 
-    def runTest(self):
-        """
-        Empty function pointer, that should NEVER be called. It is required to exist by unittest.
-        """
-        assert False
-
     def __get_bugnumber(self):
         return self.spec['test'].get('Bugzilla')
 
diff --git a/tests/functional-tests/meson.build b/tests/functional-tests/meson.build
index 8c542efbb..a1fc08ebd 100644
--- a/tests/functional-tests/meson.build
+++ b/tests/functional-tests/meson.build
@@ -42,11 +42,9 @@ extractor_tests = [
 # MusicBrainz tags
 if gstreamer.found() and gstreamer.version() >= '1.18.0'
   extractor_tests += 'audio/flac-musicbrainz'
+  extractor_tests += 'audio/vorbis-musicbrainz'
 else
   extractor_tests += 'audio/flac'
-endif
-
-if libvorbis.found()
   extractor_tests += 'audio/vorbis'
 endif
 
@@ -129,7 +127,7 @@ if libjpeg.found() and libgif.found() and libpng.found() and libtiff.found() and
   ]
 endif
 
-if libvorbis.found() and flac.found() and generic_media_handler_name != 'none'
+if generic_media_handler_name != 'none'
   functional_tests += 'writeback-audio'
 endif
 
diff --git a/tests/functional-tests/test-extraction-data/audio/vorbis.expected.json 
b/tests/functional-tests/test-extraction-data/audio/vorbis.expected.json
index b13a8649a..5c6e7f94e 100644
--- a/tests/functional-tests/test-extraction-data/audio/vorbis.expected.json
+++ b/tests/functional-tests/test-extraction-data/audio/vorbis.expected.json
@@ -1,29 +1,37 @@
 {
     "test": {
-        "Filename": "vorbis.ogg",
-        "Bugzilla": "",
-        "Comment": "Basic OGG example"
+        "Filename": "vorbis.ogg"
     },
     "metadata": {
-        "@type": "nmm:MusicPiece",
+        "@type": ["nfo:Audio", "nmm:MusicPiece"],
         "nie:title": "Simply Juvenile",
         "nfo:genre": "Pop",
         "nie:copyright": "none",
         "nie:comment": "I am for simple OGG testing",
         "nmm:trackNumber": "18",
+        "nfo:channels": 1,
+        "nfo:sampleRate": 22050,
         "nfo:duration": "15",
         "nmm:performer": {
+            "@id": "urn:artist:AbBaby",
             "@type": "nmm:Artist",
             "nmm:artistName": "AbBaby",
-            "tracker:hasExternalReference": {
-                "@id": "https://musicbrainz.org/artist/234561";,
-                "@type": "tracker:ExternalReference",
-                "tracker:referenceSource": "https://musicbrainz.org/doc/Artist";,
-                "tracker:referenceIdentifier": "234561"
-            }
+            "tracker:hasExternalReference": [
+                {
+                    "@id": "https://musicbrainz.org/artist/234561";,
+                    "@type": "tracker:ExternalReference",
+                    "tracker:referenceSource": "https://musicbrainz.org/doc/Artist";,
+                    "tracker:referenceIdentifier": "234561"
+                }
+            ]
+        },
+        "nmm:composer": {
+            "@id": "urn:artist:Ab",
+            "@type": "nmm:Artist",
+            "nmm:artistName": "Ab"
         },
         "nmm:musicAlbum": {
-            "@id": "urn:album:SinCos:2008-01-01T00:00:00Z",
+            "@id": "urn:album:SinCos:2008-01-01T00:00:00+00:00",
             "@type": "nmm:MusicAlbum",
             "nie:title": "SinCos",
             "tracker:hasExternalReference": [
@@ -32,18 +40,13 @@
                     "@type": "tracker:ExternalReference",
                     "tracker:referenceSource": "https://musicbrainz.org/doc/Release";,
                     "tracker:referenceIdentifier": "345612"
-                },
-                {
-                    "@id": "https://musicbrainz.org/release-group/561234";,
-                    "@type": "tracker:ExternalReference",
-                    "tracker:referenceSource": "https://musicbrainz.org/doc/Release_Group";,
-                    "tracker:referenceIdentifier": "561234"
                 }
             ]
         },
         "nmm:musicAlbumDisc": {
-            "@id": "urn:album-disc:SinCos:2008-01-01T00:00:00Z:Disc1",
+            "@id": "urn:album-disc:SinCos:2008-01-01T00:00:00+00:00:Disc1",
             "@type": "nmm:MusicAlbumDisc",
+            "nmm:albumDiscAlbum": "urn:album:SinCos:2008-01-01T00:00:00+00:00",
             "nmm:setNumber": 1
         },
         "tracker:hasExternalReference": [
@@ -52,21 +55,6 @@
                 "@type": "tracker:ExternalReference",
                 "tracker:referenceSource": "https://musicbrainz.org/doc/Recording";,
                 "tracker:referenceIdentifier": "456123"
-            },
-            {
-                "@id": "https://musicbrainz.org/track/123456";,
-                "@type": "tracker:ExternalReference",
-                "tracker:referenceSource": "https://musicbrainz.org/doc/Track";,
-                "tracker:referenceIdentifier": "123456"
-            }
-        ],
-        "nie:isStoredAs": [
-            {
-                "nfo:hasHash": {
-                    "nfo:hashValue": "111222",
-                    "nfo:hashAlgorithm": "chromaprint",
-                    "@type": "nfo:FileHash"
-                }
             }
         ]
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]