A beets plugin to copy/moves non-music extra files, attachments, and artifacts during the import process.
Project description
Filetote plugin for beets
A plugin that moves non-music extra files, attachments, and artifacts during the import process for beets, a music library manager (and much more!).
Installing
Stable
In the future, the stable version of the plugin will be available from PyPI.
Installation will be able to be done using pip3
:
pip3 install beets-filetote
If you get permission errors, try running it with sudo
.
Development
The development version can be installed from GitHub by using these commands:
git clone https://github.com/gtronset/beets-filetote.git
cd beets-filetote
python setup.py install
If you get permission errors, try running it with sudo
.
Configuration
You will need to enable the plugin in beets' config.yaml
:
plugins: filetote
It can copy files by file extension:
filetote:
extensions: .cue .log
Or copy files by filename:
filetote:
filenames: song.log
Or copy all non-music files (it does this by default):
filetote:
extensions: .*
It can look for and target "pairs" (files having the same name as a matching or "paired" media item/track):
filetote:
pairing: True
And target/include only paired files:
filetote:
pairing: True
pairing_only: True
It can also exclude files by name:
filetote:
exclude: song_lyrics.nfo
And print what got left:
filetote:
print_ignored: yes
exclude
-d files take precedence over other matching, meaning exclude will
trump other matches by either extensions
or filenames
.
Import Operations
This plugin supports the same operations as beets:
copy
move
link
(symlink)harklink
reflink
These options are mutually exclusive, and there are nuances to how beets (and thus this plugin) behave when there multiple set. See the beets documentation for more details.
Renaming files
Renaming works in much the same way as beets Path Formats. This plugin supports the below new path queries (from least to most specific). Each takes a single corresponding value.
ext:
paired_ext:
filename:
Renaming has the following considerations:
- The fields available are
$artist
,$albumartist
,$album
,$albumpath
,$old_filename
(filename of the extra/artifcat file before its renamed),$medianame_old
(filename of the item/track triggering it, before its renamed), and$medianame_new
(filename of the item/track triggering it, after its renamed). - The full set of
built in functions
are also supported, with the exception of
%aunique
- which will return an empty string. filename:
path query will take precedence overpaired_ext:
andext:
if a given file qualifies for them.paired_ext:
takes precedence overext:
, but is not required.
Each template string uses a query syntax for each of the file
extensions. For example the following template string will be applied to
.log
files by using the ext:
query:
paths:
ext:.log: $albumpath/$artist - $album
This will rename a log file to:
~/Music/Artist/2014 - Album/Artist - Album.log
Or by using the filename:
query:
paths:
filename:track.log: $albumpath/$artist - $album
This will rename the specific track.log
log file to:
~/Music/Artist/2014 - Album/Artist - Album.log
Note: if the rename is set and there are multiple files that qualify, only the first will be added to the library (new folder); other files that subsequently match will not be saved/renamed. To work around this,
$old_filename
can be used to help with adding uniqueness to the name.
Example config.yaml
plugins: filetote
paths:
default: $albumartist/$year - $album/$track - $title
singleton: Singletons/$artist - $title
ext:.log: $albumpath/$artist - $album
ext:.cue: $albumpath/$artist - $album
paired_ext:.lrc: $albumpath/$medianame_old
filename:cover.jpg: $albumpath/cover
filetote:
extensions: .cue .log .jpg .lrc
filename: "cover.jpg"
pairing: True
print_ignored: yes
Thanks
This plugin originally was a fork from copyartifacts3 (Adrian Sampson) (no
longer actively maintained) to expand functionality. beets-copyartifacts3
itself a fork of the archived copyartifacts (Sami Barakat).
Filetote was built on top of the excellent work done by Sami Barakat, Adrian Sampson, and the larger community on beets.
Please report any issues you may have and feel free to contribute.
License
Copyright (c) 2022 Gavin Tronset Copyright (c) 2020 Adam Miller Copyright (c) 2015-2017 Sami Barakat
Licensed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file beets_filetote-0.3.1.tar.gz
.
File metadata
- Download URL: beets_filetote-0.3.1.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.7 Darwin/21.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bbef6cee610d759b9fbb7d12facbdd9b456150fc724719158628a97d5a7abb2 |
|
MD5 | 95c7585480aa848e0d18f65afe491d9e |
|
BLAKE2b-256 | bc912965e3e50f4a5f54ef931855f8e08909fd802b6c79b72600bded9f4620cf |
File details
Details for the file beets_filetote-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: beets_filetote-0.3.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.7 Darwin/21.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5a6bf312934c1a2bf82f87e74a2be2d5e822249c59e34cf181b7970e04ce1fe |
|
MD5 | 080b6fa97b7c2e6e9ab8bc1af29dc97a |
|
BLAKE2b-256 | cd915840828ab762e091b554a7bba41b4c1c47f4d1ff4e77580e55262897f8ac |