From 07843128238d984e28fa64c64248324f3e29c8e1 Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Sat, 29 Jul 2023 08:16:18 +0200 Subject: [PATCH 01/11] refactor: change make_playlist function for better performance --- mkpl.py | 53 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/mkpl.py b/mkpl.py index 9d33ef8..547b544 100644 --- a/mkpl.py +++ b/mkpl.py @@ -99,7 +99,7 @@ def get_args(): metavar="FORMAT", ) parser.add_argument( - "-p", "--pattern", help="Regular expression inclusion pattern", default=".*" + "-p", "--pattern", help="Regular expression inclusion pattern", default=None ) parser.add_argument( "-f", @@ -290,6 +290,21 @@ def vprint(verbose, *messages): print("debug:", *messages) +def unix_to_dos(path, viceversa=False): + """Substitute folder separator with windows separator + + :path: path to substitute folder separator + :viceversa: dos to unix + """ + if viceversa: + old_sep = r"\\" + new_sep = "/" + else: + old_sep = "/" + new_sep = r"\\" + return sub(old_sep, new_sep, path) + + def write_playlist( playlist, open_mode, @@ -324,8 +339,8 @@ def write_playlist( def make_playlist( directory, - pattern, file_formats, + pattern=None, sortby_name=False, sortby_date=False, sortby_track=False, @@ -355,28 +370,32 @@ def make_playlist( # Check recursive folder = "**/*" if recursive else "*" files = path.glob(folder + f".{fmt}") + # Process found files for file in files: + # Get size of file + size = file.stat().st_size + # Check absolute file names + file = str(file) if absolute else str(file.relative_to(path.parent)) + # Check file match pattern + if pattern: + # Check re pattern + compiled_pattern = re.compile(pattern) + if not find_pattern(compiled_pattern, file): + continue # Check if in exclude dirs - if any([e_path in str(file) for e_path in exclude_dirs]): + if any([e_path in file for e_path in exclude_dirs]): continue # Check if file is in playlist if unique: if file_in_playlist( - filelist, str(file), root=root if not absolute else None + filelist, file, root=root if not absolute else None ): continue - # Get size of file - size = file.stat().st_size - # Check absolute file names - file_for_pattern = str(file) - file = str(file) if absolute else str(file.relative_to(path.parent)) - # Check re pattern - compiled_pattern = re.compile(pattern) - if find_pattern(compiled_pattern, file_for_pattern): - # Check file size - if size >= min_size: - vprint(verbose, f"add multimedia file {file}") - filelist.append(sub("/", r"\\", file) if windows else file) + # Check file size + if size <= min_size: + continue + vprint(verbose, f"add multimedia file {file}") + filelist.append(unix_to_dos(file) if windows else file) # Check sort if sortby_name: filelist = sorted(filelist) @@ -477,8 +496,8 @@ def main(): for directory in args.directories: directory_files = make_playlist( directory, - args.pattern, FILE_FORMAT, + args.pattern, sortby_name=args.orderby_name, sortby_date=args.orderby_date, sortby_track=args.orderby_track, From d830301e6d2179f814a2a6f2f9ebd2d01b5f5fe7 Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Sun, 30 Jul 2023 10:19:04 +0200 Subject: [PATCH 02/11] chore: make standard the path on unique argument --- mkpl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkpl.py b/mkpl.py index 547b544..91b98b1 100644 --- a/mkpl.py +++ b/mkpl.py @@ -241,6 +241,8 @@ def file_in_playlist(playlist, file, root=None): # Check if absolute path in playlist if root: f = join(root, f) + # Make standard the path + f = unix_to_dos(f, viceversa=True) # Compare two files if cmp(f, file): return True From 8c01fe070b66a1ad66a7402e322f0f479937f687 Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Sun, 30 Jul 2023 10:24:59 +0200 Subject: [PATCH 03/11] fix: correct absolute name into make_playlist function, refs #8 --- mkpl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkpl.py b/mkpl.py index 91b98b1..fbb01c7 100644 --- a/mkpl.py +++ b/mkpl.py @@ -377,7 +377,7 @@ def make_playlist( # Get size of file size = file.stat().st_size # Check absolute file names - file = str(file) if absolute else str(file.relative_to(path.parent)) + file = str(file.resolve()) if absolute else str(file) # Check file match pattern if pattern: # Check re pattern From 5caae725bcb3bfbf85368648d33112041cc3ff89 Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Mon, 31 Jul 2023 22:24:47 +0200 Subject: [PATCH 04/11] chore: add open_multimedia_file function --- mkpl.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/mkpl.py b/mkpl.py index fbb01c7..5344e9c 100644 --- a/mkpl.py +++ b/mkpl.py @@ -32,7 +32,7 @@ from re import sub from string import capwords -from mutagen import File +from mutagen import File, MutagenError # endregion @@ -258,24 +258,37 @@ def report_issue(exc): exit(1) +def open_multimedia_file(path): + """Open multimedia file + + :param path: multimedia file to open + """ + try: + file = File(path) + except MutagenError: + print(f"warning: file '{path}' loading failed") + return False + return file + + def get_track(file): """Sort file by track""" - file = File(file) - if hasattr(file, "tags"): + file = open_multimedia_file(file) + if file and hasattr(file, "tags"): return file.tags.get("TRCK", "0")[0] def find_pattern(pattern, path): """Find patter in a file and tags""" - file = File(path) + file = open_multimedia_file(path) # Create compiled pattern if not isinstance(pattern, re.Pattern): pattern = re.compile(pattern) # Check pattern into filename - if pattern.findall(file.filename): + if pattern.findall(path): return True # Check supports of ID3 tagsadd compiled pattern - if hasattr(file, "ID3"): + if file and hasattr(file, "ID3"): # Check pattern into title for title in file.tags.get("TIT2"): if pattern.findall(title): @@ -295,8 +308,8 @@ def vprint(verbose, *messages): def unix_to_dos(path, viceversa=False): """Substitute folder separator with windows separator - :path: path to substitute folder separator - :viceversa: dos to unix + :param path: path to substitute folder separator + :param viceversa: dos to unix """ if viceversa: old_sep = r"\\" From 3c3d442d342dcebed5c039da03df945b536b45fa Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Mon, 31 Jul 2023 22:31:07 +0200 Subject: [PATCH 05/11] fix: check if playlist is not empty before writes it to file --- mkpl.py | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/mkpl.py b/mkpl.py index 5344e9c..eaeb736 100644 --- a/mkpl.py +++ b/mkpl.py @@ -272,7 +272,7 @@ def open_multimedia_file(path): def get_track(file): - """Sort file by track""" + """Get file by track for sort""" file = open_multimedia_file(file) if file and hasattr(file, "tags"): return file.tags.get("TRCK", "0")[0] @@ -332,24 +332,25 @@ def write_playlist( verbose=False, ): """Write playlist into file""" - with open( - playlist, - mode=open_mode, - encoding="UTF-8" if encoding == "UNICODE" else encoding, - errors="ignore", - ) as pl: - if image and enabled_extensions: - vprint(verbose, f"set image {image}") - joined_string = f"\n#EXTIMG: {image}\n" - else: - joined_string = "\n" - end_file_string = "\n" - # Write extensions if exists - if ext_part: - pl.write("\n".join(files[:ext_part]) + joined_string) - # Write all multimedia files - vprint(verbose, f"write playlist {pl.name}") - pl.write(joined_string.join(files[ext_part:max_tracks]) + end_file_string) + if playlist: + with open( + playlist, + mode=open_mode, + encoding="UTF-8" if encoding == "UNICODE" else encoding, + errors="ignore", + ) as pl: + if image and enabled_extensions: + vprint(verbose, f"set image {image}") + joined_string = f"\n#EXTIMG: {image}\n" + else: + joined_string = "\n" + end_file_string = "\n" + # Write extensions if exists + if ext_part: + pl.write("\n".join(files[:ext_part]) + joined_string) + # Write all multimedia files + vprint(verbose, f"write playlist {pl.name}") + pl.write(joined_string.join(files[ext_part:max_tracks]) + end_file_string) def make_playlist( From c985074ced836cdf05b349e2b6ffcf2b749d9366 Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Wed, 2 Aug 2023 12:22:22 +0200 Subject: [PATCH 06/11] chore: add orderby-year argument --- README.md | 6 +++--- mkpl.py | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6ac0f2c..3c1f8a0 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ $ python setup.py install # for others | -o | --orderby-name | Order playlist files by name | | | -O | --orderby-date | Order playlist files by creation date | | | -T | --orderby-track | Order playlist files by track | | +| -y | --orderby-year | Order playlist files by year | | ## Examples @@ -142,12 +143,13 @@ $ python setup.py install # for others ... ``` -15. Sort playlist files by name (`-o`), by creation date (`-O`) or by track number (`-T`): +15. Sort playlist files by name (`-o`), by creation date (`-O`), by track number (`-T`) or by year (`-y`): ```bash mkpl -d "new_collection" -r "my music.m3u" -o mkpl -d "new_collection" -r "my music.m3u" -O mkpl -d "new_collection" -r "my music.m3u" -T + mkpl -d "new_collection" -r "my music.m3u" -y ``` ## Use it like Python module @@ -185,8 +187,6 @@ The Telethon Foundation is a non-profit organization recognized by the Ministry They were born in 1990 to respond to the appeal of patients suffering from rare diseases. Come today, we are organized to dare to listen to them and answers, every day of the year. - Telethon - [Adopt the future](https://www.ioadottoilfuturo.it/) diff --git a/mkpl.py b/mkpl.py index eaeb736..0e4878a 100644 --- a/mkpl.py +++ b/mkpl.py @@ -32,7 +32,7 @@ from re import sub from string import capwords -from mutagen import File, MutagenError +from mutagen import File, MutagenError, id3 # endregion @@ -174,6 +174,12 @@ def get_args(): help="Order playlist files by track", action="store_true", ) + orderby_group.add_argument( + "-y", + "--orderby-year", + help="Order playlist files by year", + action="store_true", + ) args = parser.parse_args() @@ -275,7 +281,16 @@ def get_track(file): """Get file by track for sort""" file = open_multimedia_file(file) if file and hasattr(file, "tags"): - return file.tags.get("TRCK", "0")[0] + default = id3.TRCK(text="0") + return file.tags.get("TRCK", default)[0] + + +def get_year(file): + """Get file by year for sort""" + file = open_multimedia_file(file) + if file and hasattr(file, "tags"): + default = id3.TDOR(text="0") + return file.tags.get("TDOR", default)[0] def find_pattern(pattern, path): @@ -360,6 +375,7 @@ def make_playlist( sortby_name=False, sortby_date=False, sortby_track=False, + sortby_year=False, recursive=False, exclude_dirs=None, unique=False, @@ -419,6 +435,8 @@ def make_playlist( filelist = sorted(filelist, key=getctime) elif sortby_track: filelist = sorted(filelist, key=get_track) + elif sortby_year: + filelist = sorted(filelist, key=get_year) return filelist @@ -517,6 +535,7 @@ def main(): sortby_name=args.orderby_name, sortby_date=args.orderby_date, sortby_track=args.orderby_track, + sortby_year=args.orderby_year, recursive=args.recursive, exclude_dirs=args.exclude_dirs, unique=args.unique, From c9fa4746e75f334fbb759f881d70f252212b24f7 Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Wed, 2 Aug 2023 13:16:34 +0200 Subject: [PATCH 07/11] chore: add join argument --- README.md | 8 +++++++- mkpl.py | 30 ++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3c1f8a0..1cc34d6 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ $ python setup.py install # for others | -t | --title | Playlist title | Title string | | -g | --encoding | Text encoding | UTF-8,ASCII,UNICODE | | -I | --image | Playlist image | Image path | -| -l | --link | Add remote file links | Links | +| -l | --link | Add local or remote files | Files | +| -j | --join | Join one or more other playlist files | Playlist files | | -r | --recursive | Recursive search | | | -a | --absolute | Absolute file name | | | -s | --shuffle | Casual order | | @@ -152,6 +153,11 @@ $ python setup.py install # for others mkpl -d "new_collection" -r "my music.m3u" -y ``` +16. Join the _"First playlist.m3u"_ and _"Second playlist.m3u8"_ with new **"Third playlist.m3u"**: + + ```bash + mkpl -d "new_collection" -r "Third playlist" -j "First playlist.m3u" "Second playlist.m3u8" + ## Use it like Python module `mkpl` can also be used as a Python module to customize your scripts. diff --git a/mkpl.py b/mkpl.py index 0e4878a..3244140 100644 --- a/mkpl.py +++ b/mkpl.py @@ -66,7 +66,7 @@ def get_args(): global FILE_FORMAT parser = argparse.ArgumentParser( - description="Command line tool to create media playlists in M3U format.", + description="Command line tool to creates playlist file in M3U format.", formatter_class=argparse.ArgumentDefaultsHelpFormatter, epilog="See latest release from https://github.com/MatteoGuadrini/mkpl", ) @@ -131,8 +131,17 @@ def get_args(): parser.add_argument( "-l", "--link", - help="Add remote file links", + help="Add local or remote file links", nargs=argparse.ONE_OR_MORE, + metavar='FILES', + default=[], + ) + parser.add_argument( + "-j", + "--join", + help="Join one or more other playlist files", + nargs=argparse.ONE_OR_MORE, + metavar='PLAYLISTS', default=[], ) parser.add_argument( @@ -254,6 +263,19 @@ def file_in_playlist(playlist, file, root=None): return True +def join_playlist(playlist, *others): + """Join current playlist with others""" + for file in others: + try: + # open playlist, remove extensions and extend current playlist file + lines = open(file).readlines() + playlist.extend([line.rstrip() for line in lines if not line.startswith('#')]) + except FileNotFoundError: + print(f"warning: {file} file not found") + except OSError as err: + print(f"warning: {file} generated error: {err}") + + def report_issue(exc): """Report issue""" print( @@ -483,6 +505,10 @@ def add_extension(filelist, cli_args, verbose=False): def _process_playlist(files, cli_args, other_playlist=None): """Private function cli only for process arguments and make playlist""" + # Join other playlist files + if cli_args.join: + join_playlist(files, *cli_args.join) + # Add link files.extend(cli_args.link) From f0ecc15515c9c56500d00c0ea797e80ce179fab7 Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Wed, 2 Aug 2023 16:41:13 +0200 Subject: [PATCH 08/11] chore: add logo --- README.md | 8 +++++--- img/mkpl_logo.svg | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 img/mkpl_logo.svg diff --git a/README.md b/README.md index 1cc34d6..00810c8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# ``make_playlist``: Make playlist command line tool +# ``make_playlist``: Playlist maker -``mkpl`` is a _command line tool_ to create playlist files (**[M3U](https://en.wikipedia.org/wiki/M3U) format**). +![mkpl](img/mkpl_logo.svg) + +``mkpl`` is a _command line tool_ to create playlist files in (**[M3U](https://en.wikipedia.org/wiki/M3U) format**). ## Installation @@ -167,8 +169,8 @@ from make_playlist import * # Prepare playlist list: find multimedia files with name starts between a and f playlist = make_playlist('/Music/collections', - '^[a-f].*', ('mp3', 'mp4', 'aac'), + '^[a-f].*', recursive=True, unique=True) diff --git a/img/mkpl_logo.svg b/img/mkpl_logo.svg new file mode 100644 index 0000000..8291ad0 --- /dev/null +++ b/img/mkpl_logo.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From e90799406688ddeba6fc02b162be53ae51a3cbf5 Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Thu, 3 Aug 2023 12:46:42 +0200 Subject: [PATCH 09/11] fix: add check extension of file before open tags --- README.md | 6 +++--- mkpl.py | 47 +++++++++++++++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 00810c8..dceaad3 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # ``make_playlist``: Playlist maker -![mkpl](img/mkpl_logo.svg) +mkpl -``mkpl`` is a _command line tool_ to create playlist files in (**[M3U](https://en.wikipedia.org/wiki/M3U) format**). +``mkpl`` is a _command line tool_ to create playlist files (**[M3U](https://en.wikipedia.org/wiki/M3U) format**). ## Installation @@ -15,7 +15,7 @@ $ dnf copr enable matteoguadrini/mkpl $ dnf install python-make_playlist -y # for Red Hat and fedora $ git clone https://github.com/MatteoGuadrini/mkpl.git && cd mkpl -$ python setup.py install # for others +$ pip install . # for others ``` ## Command arguments diff --git a/mkpl.py b/mkpl.py index 3244140..6534c84 100644 --- a/mkpl.py +++ b/mkpl.py @@ -24,6 +24,7 @@ # region imports import argparse +import os.path import re from filecmp import cmp from os.path import basename, dirname, exists, getctime, getsize, isdir, join, normpath @@ -50,8 +51,25 @@ "flac", "alac", "opus", + "ape", + "webm", +} +VIDEO_FORMAT = { + "mp4", + "avi", + "xvid", + "divx", + "mpeg", + "mpg", + "mov", + "wmv", + "flv", + "vob", + "asf", + "m4v", + "3gp", + "f4a", } -VIDEO_FORMAT = {"mp4", "avi", "xvid", "divx", "mpeg", "mpg", "mov", "wmv"} FILE_FORMAT = AUDIO_FORMAT.union(VIDEO_FORMAT) __version__ = "1.7.0" @@ -317,23 +335,28 @@ def get_year(file): def find_pattern(pattern, path): """Find patter in a file and tags""" - file = open_multimedia_file(path) + global AUDIO_FORMAT + # Create compiled pattern if not isinstance(pattern, re.Pattern): pattern = re.compile(pattern) # Check pattern into filename if pattern.findall(path): return True - # Check supports of ID3 tagsadd compiled pattern - if file and hasattr(file, "ID3"): - # Check pattern into title - for title in file.tags.get("TIT2"): - if pattern.findall(title): - return True - # Check pattern into album - for album in file.tags.get("TALB"): - if pattern.findall(album): - return True + # Check type of file + ext = os.path.splitext(path)[1].replace('.', '').lower() + if ext in AUDIO_FORMAT: + file = open_multimedia_file(path) + # Check supports of ID3 tagsadd compiled pattern + if file and hasattr(file, "ID3"): + # Check pattern into title + if file.tags.get("TIT2"): + if pattern.findall(file.tags.get("TIT2")[0]): + return True + # Check pattern into album + if file.tags.get("TALB"): + if pattern.findall(file.tags.get("TALB")[0]): + return True def vprint(verbose, *messages): From a7769429e532f558ffd311de5c4e89f7ae2cd382 Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Thu, 3 Aug 2023 12:47:31 +0200 Subject: [PATCH 10/11] chore: migrate to pyproject.toml installation --- MANIFEST.in | 1 - __info__.py | 28 ------------------------ pyproject.toml | 34 +++++++++++++++++++++++++++++ setup.py | 59 -------------------------------------------------- 4 files changed, 34 insertions(+), 88 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 __info__.py create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 83dcafa..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include __info__.py \ No newline at end of file diff --git a/__info__.py b/__info__.py deleted file mode 100644 index da4f3bb..0000000 --- a/__info__.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 -# -*- encoding: utf-8 -*- -# vim: se ts=4 et syn=python: - -# created by: matteo.guadrini -# __info__ -- mkpl -# -# Copyright (C) 2023 Matteo Guadrini -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -"""Information variable used by modules on this package.""" - -__version__ = '1.7.0' -__author__ = 'Matteo Guadrini' -__email__ = 'matteo.guadrini@hotmail.it' -__homepage__ = 'https://github.com/MatteoGuadrini/mkpl' diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..cdf5b88 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,34 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +py-modules = ["mkpl"] + +[project] +name = "make_playlist" +version = "1.7.0" +readme = "README.md" + +authors = [{ name = "Matteo Guadrini", email = "matteo.guadrini@hotmail.it" }] +maintainers = [ + { name = "Matteo Guadrini", email = "matteo.guadrini@hotmail.it" }, +] + +description = "Make M3U format playlist from command line." +requires-python = ">=3.6" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: OS Independent", +] +dependencies = ["mutagen"] + +[project.scripts] +mkpl = "mkpl:main" +make_playlist = "mkpl:main" + +[project.urls] +homepage = "https://github.com/MatteoGuadrini/mkpl" +documentation = "https://matteoguadrini.github.io/mkpl/" +changelog = "https://github.com/MatteoGuadrini/mkpl/blob/master/CHANGES.md" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 4e7a629..0000000 --- a/setup.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python3 -# -*- encoding: utf-8 -*- -# vim: se ts=4 et syn=python: - -# created by: matteo.guadrini -# setup -- mkpl -# -# Copyright (C) 2023 Matteo Guadrini -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -import __info__ -from setuptools import setup - -with open("README.md", "r") as fh: - long_description = fh.read() - -setup( - name='make_playlist', - version=__info__.__version__, - url=__info__.__homepage__, - project_urls={ - 'Documentation': __info__.__homepage__, - 'GitHub Project': __info__.__homepage__, - 'Issue Tracker': __info__.__homepage__ + '/issues' - }, - install_requires=["mutagen"], - license='GNU General Public License v3.0', - author=__info__.__author__, - author_email=__info__.__email__, - maintainer=__info__.__author__, - maintainer_email=__info__.__email__, - description='Make M3U format playlist from command line', - long_description=long_description, - long_description_content_type="text/markdown", - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Operating System :: OS Independent" - ], - entry_points={ - 'console_scripts': [ - 'mkpl = mkpl:main', - 'make_playlist = mkpl:main', - ] - }, - python_requires='>=3.5' -) From 6ae55200f625a767f0a393e78be1400cd8ba559d Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Thu, 3 Aug 2023 13:00:23 +0200 Subject: [PATCH 11/11] chore: new minor version --- CHANGES.md | 14 ++++++++++++++ mkpl.py | 2 +- pyproject.toml | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 308cc6a..cb42f46 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,19 @@ # Release notes +## 1.8.0 +Aug 03, 2023 + +- Refactor _make_playlist_ function for better performance +- Add standard path on unique argument +- Add _open_multimedia_file_ function +- Add `orderby-year` cli argument +- Add `join` cli argument +- Add mkpl logo +- Migrate to pyproject.toml installation +- Fix absolute name into _make_playlist_ function, refs #8 +- Fix check if playlist is not empty before writes it to file +- Fix check extension of file before open tags + ## 1.7.0 Jun 12, 2023 diff --git a/mkpl.py b/mkpl.py index 6534c84..32a8ada 100644 --- a/mkpl.py +++ b/mkpl.py @@ -71,7 +71,7 @@ "f4a", } FILE_FORMAT = AUDIO_FORMAT.union(VIDEO_FORMAT) -__version__ = "1.7.0" +__version__ = "1.8.0" # endregion diff --git a/pyproject.toml b/pyproject.toml index cdf5b88..13409d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ py-modules = ["mkpl"] [project] name = "make_playlist" -version = "1.7.0" +version = "1.8.0" readme = "README.md" authors = [{ name = "Matteo Guadrini", email = "matteo.guadrini@hotmail.it" }]