New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beets Work Queue Discussion #1375
Comments
Hi, you could try to use unison sync tool, it has something similar to what you propose. |
@guibog I'm not really sure how the Unison Sync tool, fulfills the use case I outlined in my original post. Can you explain further. |
Thanks for bringing this up! This is a great idea to begin discussing. There are some notes on the same idea on the wiki: https://github.com/sampsyo/beets/wiki/Refactoring This would be a huge amount of work, but I'm especially excited for the alternate UI possibilities this might open up. |
I had a look at the Asynchronous import decisions and it is pretty much what i described too. So I'm glad other people have been thinking about this too. I think a simple method by far will be the best. Using a SQLite table to insert the task that requires completion, along with a status, and outcome of actions. Then a separate instance of beets could be run which runs in a daemon mode, and picks up any pending tasks, and proceeds to work on them, and update the SQLite table as required. This demon, can handle all the priority etc. Then whenever you run an instance of Then What we need to figure first is what is the best solution that we can implement that is expandable not only to the autotagger but that other plugins can potentially hook into. I know there are other engines such as Celery which we could use, but is that the best idea? Could be, as we don't really want to reinvent the wheel. |
What about re-using the existing database structure? That is, we'd just have a "pending" flag on items and albums indicating that they've been tracked but not fully imported yet. Or, possibly, a more general "status" field indicating which tasks have been run on them so far. |
A general status makes sense, but sometime we need more than one. For instance, I have my big library imported but because I am obsessive about it, I haven't dared yet to write tags to files and move them. If I ever do that, ideally I would like to do it step by step, and be able to know which file was written/moved when. Another example: MusicBrainz data is updated from time to time, so I would like a "last_checked_on_mb" status. For these kind of things, I have a taste for event tables: "id | entity_id | event_name | timestamp". This is a bit like a log, and allow for much flexibility, at the cost of a bit more complexity in SQL queries. Example of events that could apply:
|
@sampsyo - I wouldn't want to use the existing database structure as it wasn't designed to be used for this type of feature, meaning it won't be able to be easily expanded to allow additional functionality. If the autotagger runs in the background, then it has more time to request more information, and store that info. So if its confidence was low, it could automatically request and store additional candidates, or plugins could hook into it, such as lyrics, and autodownload and store lyrics. I wouldn't want to muddy the existing table with this information. @guibog - I think a log file should is a good addition to beets, but that should be a beets core function. It should be logging what it does. This way we can see what changes were applied at what time. This can then be used to roll back changes. But this should be raised as a separate feature. What we need is a table which stores
This is the basic information, that I think could be supplied to a beets daemon. So when i run a beets import, i can specify to run it in the background. This adds it to the task list, and then the daemon will begin processing it. Once processed it will change its status to I can then fire up beets frontend, and run a command which lists all tasks, and any actions I need to take against them. This way in your scenario @guibog i can create a cron job which queries my library each week for updates to musicbrains data, and it runs in the background, kepping my data in sync. A status of superseded could also be used which can invalidate a previous import by a new import. |
Thanks of the comments. I'm still not quite sure why this functionality would "muddy the existing table"—we can of course hide the new functionality from other user-facing interactions (i.e., pending stuff would not show up in |
@sampsyo - Sounds like a good idea. Are you able to provide an export of the main tables beets uses along with columns, and a typical subset of data, maybe 100 rows? Maybe paste in a gist (comma/tab separated). That would help with the design and visualisation. |
You can get this from your own library using the SQLite command-line program:
|
@SamPsy - Thanks. My library isn't as fully featured at the moment with plugins etc, but i will dump mine anyway. I can already envision a issues with using the existing table, but I will get them noted down anyway. |
from #1538 : It would be awesome if we could run
which then writes a file similar to a temporary commit message file. It would contain the interactive prompt:
I would then put a character with whatever choice I decide on:
and the next item would follow. Then i could call
and beets would apply my choices. This would help with the dreadful importing stage. (I am importing my library since... a few days ago, and it's still going on) |
Based on previous discussions should we look into a simple python package which we can use a a task system. Something which will underpin the entire concept is the ability to add tasks to a queue and process them and get back results. We ideally need the following requirements in my opinion
Nice to haves would be:
Many tasks based queues use a back end broker, a popular one is Redis. I'm not sure we want to include another dependency onto beets, but this tasked based system could be a config option, allow people to use it without a back end broker. Any suggestions? |
This does sound like approximately the right list of requirements. For beets, though, I'd argue that something much simpler than Redis would be the right way to go—in particular, just storing "tasks" as records in a SQLite database should work great. In particular, I'm nervous about any solution that involves a separate process just to store and distribute tasks. That's good for a server setting, where lots of daemons run constantly anyway, but less good for an interactive, user-facing application. What do you think of a simple database-backed queue? |
I understand your hesitance for an external system to manage queues and I I've been looking into a database backed system, but I havnt had much luck. Maybe a new table in the db...or a new database entirely (I dont like the For the amount of tasks that we will run (minimal) and the features
|
No activity on this for some time, but this feature would unlock just about the most ideal import process I can imagine for music library software. Being able to navigate tagging decisions as interactions with a Telegram bot on my own time, as new music comes in via automated processes... 😍 |
Work Queue Discussion
I wanted to start a discussion on work queuing.
With current beets functionality, you run the command
beet import ~/music
and that folder is imported but in an interactive state.Beets can be run in a psudo non-interactive state, but at the risk of reducing the confidence of the autotagger.
What I would like is the ability to still have the full functionality of beets, but simply at a later date, which is why I would like to a see a task based functionality implemented.
Proposed Scenario
Here are my proposed scenario:
beet import
with a switch to run in an non-interactive modebeet tasks
or something to that effectMaybe this tasks functionality could also be used to hold other tasks or actions such as
Applications
The applications for this are the following:
Thoughts? Discussions? Implementation ideas?
The text was updated successfully, but these errors were encountered: