From a74f27bc6100895a5e23ffa957540326dfb567d3 Mon Sep 17 00:00:00 2001 From: kernitus <2789734+kernitus@users.noreply.github.com> Date: Wed, 25 Jan 2023 16:52:18 +0000 Subject: [PATCH] Add to pip --- .gitignore | 1 + README.md | 4 +--- beetsplug/__init__.py | 3 --- pyproject.toml | 31 +++++++++++++++++++++++++++++++ requirements.txt | 4 ---- setup.py | 6 ------ 6 files changed, 33 insertions(+), 16 deletions(-) delete mode 100644 beetsplug/__init__.py create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 9a05e2d..92bdcb1 100644 --- a/.gitignore +++ b/.gitignore @@ -89,3 +89,4 @@ ENV/ # Rope project settings .ropeproject +/.idea/ diff --git a/README.md b/README.md index 70fa255..4c77301 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Beets plugin that fetches oldest recording or release date for each track. This is especially useful when tracks are from best-of compilations, remasters, or re-releases. Originally based on `beets-recordingdate` by tweitzel, but almost entirely rewritten to actually work with MusicBrainz's incomplete information. The only thing left intact is the `recording_` MP3 tags, for compatibility with `beets-recordingdate`. # Installation -Clone the repo and run `python setup.py install`, then add `oldestdate` to the list of active plugins in beets and configure as necessary. The plugin is intended to be used in singleton mode. Undefined behaviour may occur otherwise. +Simply run `pip install beets-oldestdate` then add `oldestdate` to the list of active plugins in beets and configure as necessary. The plugin is intended to be used in singleton mode. Undefined behaviour may occur otherwise. # Configuration @@ -34,8 +34,6 @@ Clone the repo and run `python setup.py install`, then add `oldestdate` to the l filter_recordings: yes approach: 'releases' - - ## How it works The plugin will take the recording that was chosen and get its `work_id`. From this, it gets all recordings associated with said work. If using the `recordings` approach, it will look through these recordings' dates and find the oldest. If using the `releases` approach, it will instead go through the dates for all releases for all recordings and find the oldest (*much* more accurate). The difference between these two approaches is that with `recordings` it only takes one API call to get the necessary data, while with `releases` it takes *n* calls, where *n* is the number of recordings. This takes significantly longer due to MusicBrainz's default ratelimit of 1 API call per second. Due to this, the option `filter_recordings` exists to cut down on the amount of calls needed. diff --git a/beetsplug/__init__.py b/beetsplug/__init__.py deleted file mode 100644 index d4de5ca..0000000 --- a/beetsplug/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -- coding: utf-8 -- -from pkgutil import extend_path -__path__ = extend_path(__path__, __name__) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2b8f0e1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "beets-oldestdate" +version = "1.1.3" +authors = [ + { name="kernitus" }, +] +description = "Beets plugin that finds oldest possible track recording or release date" +readme = "README.md" +requires-python = ">=3.7" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dependencies = [ + "mediafile~=0.9", + "musicbrainzngs~=0.7", + "python-dateutil~=2.8", + "beets~=1.6", +] + +[project.entry-points.beetsplug] +beets-oldestdate = "beets.oldestdate" + +[project.urls] +"Homepage" = "https://github.com/kernitus/beets-oldestdate" +"Bug Tracker" = "https://github.com/kernitus/beets-oldestdate/issues" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 89e93e6..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mediafile~=0.9.0 -musicbrainzngs~=0.7.1 -python-dateutil~=2.8.2 -beets~=1.6.0 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 1cf5af5..0000000 --- a/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -from setuptools import setup, find_packages -setup( - name="beets-oldestdate", - version="1.1.2", - packages=find_packages(), -)