1
0
mirror of https://github.com/gryf/pygtktalog.git synced 2025-12-17 03:20:17 +01:00

Added audio tags read support.

This commit is contained in:
2022-09-30 18:23:13 +02:00
parent 4b02641481
commit 85ab034a36
3 changed files with 9 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ pycatalog requires python and following libraries:
* `python 3.10`_ and up * `python 3.10`_ and up
* `sqlalchemy 1.4`_ * `sqlalchemy 1.4`_
* `exifread`_ for parse EXIF information * `exifread`_ for parse EXIF information
* `mutagen`_ for extracting tags from audio files
Pycatalog extensively uses external programs in unix spirit, however there is Pycatalog extensively uses external programs in unix spirit, however there is
small possibility of using it Windows (probably with limitations) and quite big small possibility of using it Windows (probably with limitations) and quite big
@@ -88,3 +89,4 @@ file in top-level directory.
.. _sqlalchemy 1.4: http://www.sqlalchemy.org .. _sqlalchemy 1.4: http://www.sqlalchemy.org
.. _tagging files: http://en.wikipedia.org/wiki/tag_%28metadata%29 .. _tagging files: http://en.wikipedia.org/wiki/tag_%28metadata%29
.. _tox: https://testrun.org/tox .. _tox: https://testrun.org/tox
.. _mutagen: https://github.com/quodlibet/mutagen

View File

@@ -11,6 +11,8 @@ from datetime import datetime
import mimetypes import mimetypes
import exifread import exifread
import mutagen
from pycatalog.dbobjects import File, TYPE from pycatalog.dbobjects import File, TYPE
from pycatalog import dbcommon from pycatalog import dbcommon
from pycatalog.logger import get_logger from pycatalog.logger import get_logger
@@ -213,8 +215,10 @@ class Scan(object):
pass pass
def _audio(self, fobj, filepath): def _audio(self, fobj, filepath):
# tags, depending on the format? tags = mutagen.File(filepath)
return if not tags:
return
fobj.description = tags.pprint()
def _image(self, fobj, filepath): def _image(self, fobj, filepath):
"""Read exif if exists, add it to description""" """Read exif if exists, add it to description"""

View File

@@ -36,6 +36,7 @@ packages =
install_requires = install_requires =
exifread exifread
sqlalchemy sqlalchemy
mutagen
[bdist_wheel] [bdist_wheel]
universal = 1 universal = 1