adamjakab / beetsplugingoingrunning Goto Github PK
View Code? Open in Web Editor NEWBeets plugin for obsessive-compulsive music geek runners.
License: MIT License
Beets plugin for obsessive-compulsive music geek runners.
License: MIT License
Often the total length of the songs is a few minutes less than the duration of the training.
I cannot use Travis anymore (needs commercial license) so publishing coverage information to coveralls.io is broken.
When beet is running in verbose mode the messages sent to the logger are redirected to stdout so there is no need to write to std again.
when using a training without duration the plugin exits with the following back trace:
(base) jakabimac:~ jackisback$ beet run shopping
Handling training: shopping
Traceback (most recent call last):
File "/Users/jackisback/opt/miniconda3/bin/beet", line 8, in <module>
sys.exit(main())
File "/Users/jackisback/opt/miniconda3/lib/python3.7/site-packages/beets/ui/__init__.py", line 1266, in main
_raw_main(args)
File "/Users/jackisback/opt/miniconda3/lib/python3.7/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/Users/jackisback/opt/miniconda3/lib/python3.7/site-packages/beetsplug/goingrunning/command.py", line 126, in func
self.handle_training()
File "/Users/jackisback/opt/miniconda3/lib/python3.7/site-packages/beetsplug/goingrunning/command.py", line 168, in handle_training
sel_items = self._get_items_for_duration(sorted_lib_items, duration)
File "/Users/jackisback/opt/miniconda3/lib/python3.7/site-packages/beetsplug/goingrunning/command.py", line 324, in _get_items_for_duration
est_num_songs = round(requested_duration * 60 / _avg)
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
When both acousticbrainz and goingrunning plugins are activated beets exits with the following error:
Traceback (most recent call last):
File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/bin/beet", line 8, in <module>
sys.exit(main())
File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/beets/ui/__init__.py", line 1266, in main
_raw_main(args)
File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/beets/ui/__init__.py", line 1249, in _raw_main
subcommands, plugins, lib = _setup(options, lib)
File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/beets/ui/__init__.py", line 1148, in _setup
library.Item._types.update(plugins.types(library.Item))
File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/beets/plugins.py", line 344, in types
u'another type.'.format(plugin.name, field)
beets.plugins.PluginConflictException: Plugin acousticbrainz defines flexible field average_loudness which has already been defined with another type.
Removing one of either plugins, the problem goes away.
I currently convert songs using the convert plugin and use some tags to export songs for my Walkman device, since it can only play mp3s. Is something like this possible when you export the files? maybe setting up a bit-rate and file type and convert files which aren't mp3s? Just a suggestion :)
Thanks a lot for this! Never thought we could use bpm like this ๐
Hi Adam,
When your plugin is installed it gives the following error in Beets 1.5+ when running any command. Even if I run e.g. beet ls -a artist
. Is this something you would be willing/have the time for to fix?
Thanks, Jan
/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/beets/mediafile.py:19: UserWarning: beets.mediafile is deprecated; use mediafile instead
warnings.warn("beets.mediafile is deprecated; use mediafile instead")
/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/beets/util/confit.py:19: UserWarning: beets.util.confit is deprecated; use confuse instead
warnings.warn("beets.util.confit is deprecated; use confuse instead")
Matching needs to be exact and not regex otherwise "Rock" will also match "Rock & Roll" from another selection. For regular expressions "^" first char can be used to distinguish if regex is needed.
with the clean_target
.m3u files are not cleared resulting in broken playlists.
when listing a training:
================================[ walking ]=================================
duration: 3:00:00
query: genre(jazz)
ordering: year+(100)
user does not get warned about a missing target.
In fact upon beet run walking
the message is not very clear:
Handling training: walking
The target name[None] is not defined!
The target name[None] is not defined!
The target[None] does not declare a device root path.
A better message would be:
Training 'walking' must define a target!
Error message: configuration error: goingrunning.trainings.walking.target not found
goingrunning:
song_bpm: [111, 222]
song_len: [120, 240]
duration: 120
target: SONY
targets:
TEST: ~/Music/tmp/
SONY: /Volumes/WALKMAN/MUSIC/AUTO/
clean_target: true
trainings:
test:
alias: "Born to run"
song_bpm: [90, 150]
song_len: [120, 300]
duration: 180
target: TEST
walking:
alias: "Born to run"
song_bpm: [0, 130]
song_len: [0, 600]
duration: 180
longrun:
alias: "Born to run"
song_bpm: [120, 150]
song_len: [120, 300]
duration: 180
beets version 1.4.9
Python version 3.7.6
plugins: convert, duplicates, fromfilename, goingrunning, info, inline, the, zero
goingrunning -l
Available trainings:
======================================== ::: test
alias: Born to run
duration: 180
song_bpm: [90, 150]
song_len: [120, 300]
target: TEST
======================================== ::: walking
alias: Born to run
duration: 180
song_bpm: [0, 130]
song_len: [0, 600]
target: SONY
======================================== ::: longrun
alias: Born to run
duration: 180
song_bpm: [120, 150]
song_len: [120, 300]
target: SONY
So configuration is correctly read
If I put the target directly on the training leaf it works.
One might do multiple consecutive trainings which will make it necessary to store multiple trainings. For example: warmup, 10K, cool-down.
Instead of clean_target: yes|no
we could have clean_target: no|training|all
target option: create separate subfolders for files on target
It would be nice to be able to change on the fly the duration of a training. For example a longrun
defined as 2hrs training at times can be also shorter or longer.
Sometimes it can take a while to copy all the songs to the target device. An optional progress bar showing the current status and ETA would be nice.
when using this configuration:
trainings:
fallback:
target: TEST
increment_play_count: yes
favour_unplayed: yes
ordering:
original_year: 25
bpm: 50
mood_aggressive: 50
danceable: 100
mood_relaxed: -100
longrun-la:
use_flavours: [running, intensity_low, genre_alternative]
duration: 150
target: SONY
and executing beet -vv run longrun-la
the plugin reports:
user configuration: /Users/jackisback/.config/beets/config.yaml
data directory: /Users/jackisback/.config/beets
plugin paths: /Users/jackisback/Documents/Projects/Python/BeetsPluginGenreFixer/beetsplug
Sending event: pluginload
inline: adding item field initial_letter
inline: adding item field disc_num_prefix
library database: /Users/jackisback/.config/beets/real_library.db
library directory: /Volumes/J/Music
Sending event: library_opened
goingrunning: Handling training: longrun-la
goingrunning: Getting attribute[device_root] for target: SONY
goingrunning: Finding target: SONY
goingrunning: Found target[SONY] attribute[device_root] path: /Volumes/WALKMAN
goingrunning: Getting attribute[device_path] for target: SONY
goingrunning: Finding target: SONY
goingrunning: Found target[SONY] attribute[device_path] path: MUSIC/AUTO
goingrunning: Found target[SONY] path: SONY
goingrunning: Command query elements: []
goingrunning: Training query elements: []
goingrunning: Flavour query elements: ["^genre:Experimental", "^genre:Christian", "^genre:Christmas", "^genre:Speech", "bpm:..110", "mood_aggressive:..0.1", "genre:Alternative Rock", "genre:Grunge", "genre:Indie", "genre:New Wave", "genre:Progressive", "genre:Psychedelic Rock", "genre:Punk", "genre:Ska"]
goingrunning: Combined query elements: ["^genre:Experimental", "^genre:Christian", "^genre:Christmas", "^genre:Speech", "bpm:..110", "mood_aggressive:..0.1", "genre:Alternative Rock", "genre:Grunge", "genre:Indie", "genre:New Wave", "genre:Progressive", "genre:Psychedelic Rock", "genre:Punk", "genre:Ska"]
goingrunning: ^genre: AndQuery([NotQuery(SubstringQuery("genre", "Experimental", True)), NotQuery(SubstringQuery("genre", "Christian", True)), NotQuery(SubstringQuery("genre", "Christmas", True)), NotQuery(SubstringQuery("genre", "Speech", True))])
goingrunning: bpm: NumericQuery("bpm", "..110", True)
goingrunning: mood_aggressive: NumericQuery("mood_aggressive", "..0.1", False)
goingrunning: genre: OrQuery([SubstringQuery("genre", "Alternative Rock", True), SubstringQuery("genre", "Grunge", True), SubstringQuery("genre", "Indie", True), SubstringQuery("genre", "New Wave", True), SubstringQuery("genre", "Progressive", True), SubstringQuery("genre", "Psychedelic Rock", True), SubstringQuery("genre", "Punk", True), SubstringQuery("genre", "Ska", True)])
goingrunning: Parsed query: AndQuery([AndQuery([NotQuery(SubstringQuery("genre", "Experimental", True)), NotQuery(SubstringQuery("genre", "Christian", True)), NotQuery(SubstringQuery("genre", "Christmas", True)), NotQuery(SubstringQuery("genre", "Speech", True))]), NumericQuery("bpm", "..110", True), NumericQuery("mood_aggressive", "..0.1", False), OrQuery([SubstringQuery("genre", "Alternative Rock", True), SubstringQuery("genre", "Grunge", True), SubstringQuery("genre", "Indie", True), SubstringQuery("genre", "New Wave", True), SubstringQuery("genre", "Progressive", True), SubstringQuery("genre", "Psychedelic Rock", True), SubstringQuery("genre", "Punk", True), SubstringQuery("genre", "Ska", True)])])
goingrunning: ORDERING permutation: ScoreBasedLinearPermutation
goingrunning: Scoring 753 items...
goingrunning: ORDER INFO: {}
goingrunning: PICKER strategy: RandomFromBinsPicker ("favour_unplayed": yes)
so the ordering key is not picked up from the fallback training. (It howvever seems that the favour_unplayed
is picked up).
GoingRunning(beets-goingrunning) plugin for Beets: v1.2.1
Some devices need their database file to be deleted otherwise they will not scan the new files on the device.
Congrats on this plugin! I'm considering it for generating sport routine playlists.
Not really a bug or something, just here to recommend adding tags to this repository for improved visibility/reachability in GitHub (personally I like to go to this page periodically to see if new plugins appear).
I've seen beets plugins repos usually having these tags:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.