[Beets] OCD Music Geek Power Tool for QNAP NAS

This is the best place for community developers to publish their genius work. Your Apps enrich the QNAP Turbo NAS.
Post Reply
User avatar
peelos
Been there, done that
Posts: 580
Joined: Sun Jun 26, 2016 9:28 pm

[Beets] OCD Music Geek Power Tool for QNAP NAS

Post by peelos »

The purpose of beets is to get your music collection right once and for all. It catalogs your collection, automatically improving its metadata as it goes using the MusicBrainz database. Then it provides a bouquet of tools for manipulating and accessing your music.

Because beets is designed as a library, it can do almost anything you can imagine for your music collection. Via plugins, beets becomes a panacea:

Fetch or calculate all the metadata you could possibly need: album art, lyrics, genres, tempos, ReplayGain levels, or acoustic fingerprints.
Get metadata from MusicBrainz, Discogs, or Beatport. Or guess metadata using songs’ filenames or their acoustic fingerprints.
Transcode audio to any format you like.
Check your library for duplicate tracks and albums or for albums that are missing tracks.
Browse your music library graphically through a Web browser and play it in any browser that supports HTML5 Audio.
…and lots more.
If beets doesn’t do what you want yet, writing your own plugin is shockingly simple if you know a little Python.

Install beets by typing pip install beets.

http://beets.io/

>>>>

I in no way developed this, but using QPython2 and the instructions on the website I have installed discogs / beatport plugins to clean up large amounts of Music into Artist/Album folder structure, all properly tagged and ready for importing into Plex :DD

Hope someone else finds this interesting / helpful..
NAS: TVS-1282-i7-7700-40G / 4 x 500GB SSD 2.5" RAID 10 / 2 x 500GB M.2 SSD / 8 x 12TB WD Whites 3.5" RAID 6 / Noctua L9x65 / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU
Software: Plex Media Server / Transmission / Sonarr / Radarr / Bazarr / Jackett / Tautulli / Home Assistant / Resilio Sync / Python / NetData / SortMyQPKGs
pfSense Firewall / OpenVPN Server: QOTOM Fanless Mini PC / Core i5 / 8GB RAM / 128GB SSD / 4 Gigabit NICs / AES-NI
Wireless Routers: 2 x Netgear AC1900 R7000 Nighthawk / 1 x Netgear AC3200 R8000 Nighthawk / FreshTomato Firmware
User avatar
peelos
Been there, done that
Posts: 580
Joined: Sun Jun 26, 2016 9:28 pm

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by peelos »

After spending some time to import various albums, I rebooted and realised that the config file was saved in /root/ which was then promptly deleted ..

so, to use this application properly one would need to set an environment variable called BEETSDIR and point to /homes/admin for example - now I need to work out how to set an environment variable, will ask in another thread and update here.
NAS: TVS-1282-i7-7700-40G / 4 x 500GB SSD 2.5" RAID 10 / 2 x 500GB M.2 SSD / 8 x 12TB WD Whites 3.5" RAID 6 / Noctua L9x65 / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU
Software: Plex Media Server / Transmission / Sonarr / Radarr / Bazarr / Jackett / Tautulli / Home Assistant / Resilio Sync / Python / NetData / SortMyQPKGs
pfSense Firewall / OpenVPN Server: QOTOM Fanless Mini PC / Core i5 / 8GB RAM / 128GB SSD / 4 Gigabit NICs / AES-NI
Wireless Routers: 2 x Netgear AC1900 R7000 Nighthawk / 1 x Netgear AC3200 R8000 Nighthawk / FreshTomato Firmware
User avatar
peelos
Been there, done that
Posts: 580
Joined: Sun Jun 26, 2016 9:28 pm

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by peelos »

Update: working well following a reboot now thanks to the instructions provided by OneCD in this post.. viewtopic.php?f=11&t=127872&p=581943#p581244
NAS: TVS-1282-i7-7700-40G / 4 x 500GB SSD 2.5" RAID 10 / 2 x 500GB M.2 SSD / 8 x 12TB WD Whites 3.5" RAID 6 / Noctua L9x65 / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU
Software: Plex Media Server / Transmission / Sonarr / Radarr / Bazarr / Jackett / Tautulli / Home Assistant / Resilio Sync / Python / NetData / SortMyQPKGs
pfSense Firewall / OpenVPN Server: QOTOM Fanless Mini PC / Core i5 / 8GB RAM / 128GB SSD / 4 Gigabit NICs / AES-NI
Wireless Routers: 2 x Netgear AC1900 R7000 Nighthawk / 1 x Netgear AC3200 R8000 Nighthawk / FreshTomato Firmware
Afrosheen
Getting the hang of things
Posts: 90
Joined: Tue Dec 23, 2014 3:51 pm

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by Afrosheen »

I'm very intrigued by this, but I'm having trouble figuring out how to install this. Any consideration in providing a tutorial here would be greatly appreciated!!
User avatar
peelos
Been there, done that
Posts: 580
Joined: Sun Jun 26, 2016 9:28 pm

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by peelos »

Afrosheen wrote:I'm very intrigued by this, but I'm having trouble figuring out how to install this. Any consideration in providing a tutorial here would be greatly appreciated!!
Just saw this, I had issues with the RAM disk getting full so did not fix the config after my last firmware update - will have another go when I get the chance (and after I finish upgrading everything to the x64 4.3.3 setup) will gladly post a tutorial when I can.
NAS: TVS-1282-i7-7700-40G / 4 x 500GB SSD 2.5" RAID 10 / 2 x 500GB M.2 SSD / 8 x 12TB WD Whites 3.5" RAID 6 / Noctua L9x65 / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU
Software: Plex Media Server / Transmission / Sonarr / Radarr / Bazarr / Jackett / Tautulli / Home Assistant / Resilio Sync / Python / NetData / SortMyQPKGs
pfSense Firewall / OpenVPN Server: QOTOM Fanless Mini PC / Core i5 / 8GB RAM / 128GB SSD / 4 Gigabit NICs / AES-NI
Wireless Routers: 2 x Netgear AC1900 R7000 Nighthawk / 1 x Netgear AC3200 R8000 Nighthawk / FreshTomato Firmware
Afrosheen
Getting the hang of things
Posts: 90
Joined: Tue Dec 23, 2014 3:51 pm

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by Afrosheen »

peelos wrote:
Afrosheen wrote:I'm very intrigued by this, but I'm having trouble figuring out how to install this. Any consideration in providing a tutorial here would be greatly appreciated!!
Just saw this, I had issues with the RAM disk getting full so did not fix the config after my last firmware update - will have another go when I get the chance (and after I finish upgrading everything to the x64 4.3.3 setup) will gladly post a tutorial when I can.
Hi peelos,

I was able to get beets to work properly for a bit, but then kept getting this error. Seems to be the RAM disk getting full, not sure if you discovered a fix?
Traceback (most recent call last):
File “/opt/bin/beet”, line 11, in
load_entry_point(‘beets==1.4.6’, ‘console_scripts’, ‘beet’)()
File “/opt/lib/python2.7/site-packages/beets/ui/init.py”, line 1256, in main
_raw_main(args)
File “/opt/lib/python2.7/site-packages/beets/ui/init.py”, line 1243, in _raw_main
subcommand.func(lib, suboptions, subargs)
File “/opt/lib/python2.7/site-packages/beets/ui/commands.py”, line 934, in import_func
import_files(lib, paths, query)
File “/opt/lib/python2.7/site-packages/beets/ui/commands.py”, line 911, in import_files
session.run()
File “/opt/lib/python2.7/site-packages/beets/importer.py”, line 325, in run
pl.run_parallel(QUEUE_SIZE)
File “/opt/lib/python2.7/site-packages/beets/util/pipeline.py”, line 445, in run_parallel
six.reraise(exc_info[0], exc_info[1], exc_info[2])
File “/opt/lib/python2.7/site-packages/beets/util/pipeline.py”, line 312, in run
out = self.coro.send(msg)
File “/opt/lib/python2.7/site-packages/beets/util/pipeline.py”, line 171, in coro
task = func(*(args + (task,)))
File “/opt/lib/python2.7/site-packages/beets/importer.py”, line 1348, in user_query
apply_choice(session, task)
File “/opt/lib/python2.7/site-packages/beets/importer.py”, line 1415, in apply_choice
task.add(session.lib)
File “/opt/lib/python2.7/site-packages/beets/importer.py”, line 716, in add
self.remove_replaced(lib)
File “/opt/lib/python2.7/site-packages/beets/importer.py”, line 791, in remove_replaced
dup_item.remove()
File “/opt/lib/python2.7/site-packages/beets/library.py”, line 741, in remove
super(Item, self).remove()
File “/opt/lib/python2.7/site-packages/beets/library.py”, line 349, in remove
super(LibModel, self).remove()
File “/opt/lib/python2.7/site-packages/beets/dbcore/db.py”, line 422, in remove
(self.id,)
File “/opt/lib/python2.7/site-packages/beets/dbcore/db.py”, line 693, in mutate
cursor = self.db._connection().execute(statement, subvals)
sqlite3.OperationalError: database or disk is full
User avatar
peelos
Been there, done that
Posts: 580
Joined: Sun Jun 26, 2016 9:28 pm

Re: RE: Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by peelos »

Afrosheen wrote:
peelos wrote:
Afrosheen wrote:I'm very intrigued by this, but I'm having trouble figuring out how to install this. Any consideration in providing a tutorial here would be greatly appreciated!!
Just saw this, I had issues with the RAM disk getting full so did not fix the config after my last firmware update - will have another go when I get the chance (and after I finish upgrading everything to the x64 4.3.3 setup) will gladly post a tutorial when I can.
Hi peelos,

I was able to get beets to work properly for a bit, but then kept getting this error. Seems to be the RAM disk getting full, not sure if you discovered a fix?
Traceback (most recent call last):
File “/opt/bin/beet”, line 11, in
load_entry_point(‘beets==1.4.6’, ‘console_scripts’, ‘beet’)()
File “/opt/lib/python2.7/site-packages/beets/ui/init.py”, line 1256, in main
_raw_main(args)
File “/opt/lib/python2.7/site-packages/beets/ui/init.py”, line 1243, in _raw_main
subcommand.func(lib, suboptions, subargs)
File “/opt/lib/python2.7/site-packages/beets/ui/commands.py”, line 934, in import_func
import_files(lib, paths, query)
File “/opt/lib/python2.7/site-packages/beets/ui/commands.py”, line 911, in import_files
session.run()
File “/opt/lib/python2.7/site-packages/beets/importer.py”, line 325, in run
pl.run_parallel(QUEUE_SIZE)
File “/opt/lib/python2.7/site-packages/beets/util/pipeline.py”, line 445, in run_parallel
six.reraise(exc_info[0], exc_info[1], exc_info[2])
File “/opt/lib/python2.7/site-packages/beets/util/pipeline.py”, line 312, in run
out = self.coro.send(msg)
File “/opt/lib/python2.7/site-packages/beets/util/pipeline.py”, line 171, in coro
task = func(*(args + (task,)))
File “/opt/lib/python2.7/site-packages/beets/importer.py”, line 1348, in user_query
apply_choice(session, task)
File “/opt/lib/python2.7/site-packages/beets/importer.py”, line 1415, in apply_choice
task.add(session.lib)
File “/opt/lib/python2.7/site-packages/beets/importer.py”, line 716, in add
self.remove_replaced(lib)
File “/opt/lib/python2.7/site-packages/beets/importer.py”, line 791, in remove_replaced
dup_item.remove()
File “/opt/lib/python2.7/site-packages/beets/library.py”, line 741, in remove
super(Item, self).remove()
File “/opt/lib/python2.7/site-packages/beets/library.py”, line 349, in remove
super(LibModel, self).remove()
File “/opt/lib/python2.7/site-packages/beets/dbcore/db.py”, line 422, in remove
(self.id,)
File “/opt/lib/python2.7/site-packages/beets/dbcore/db.py”, line 693, in mutate
cursor = self.db._connection().execute(statement, subvals)
sqlite3.OperationalError: database or disk is full
I had the same problem and unfortunately never found a fix.
NAS: TVS-1282-i7-7700-40G / 4 x 500GB SSD 2.5" RAID 10 / 2 x 500GB M.2 SSD / 8 x 12TB WD Whites 3.5" RAID 6 / Noctua L9x65 / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU
Software: Plex Media Server / Transmission / Sonarr / Radarr / Bazarr / Jackett / Tautulli / Home Assistant / Resilio Sync / Python / NetData / SortMyQPKGs
pfSense Firewall / OpenVPN Server: QOTOM Fanless Mini PC / Core i5 / 8GB RAM / 128GB SSD / 4 Gigabit NICs / AES-NI
Wireless Routers: 2 x Netgear AC1900 R7000 Nighthawk / 1 x Netgear AC3200 R8000 Nighthawk / FreshTomato Firmware
Afrosheen
Getting the hang of things
Posts: 90
Joined: Tue Dec 23, 2014 3:51 pm

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by Afrosheen »

I've created a thread on Beets discussion forum, so if anyone figures this out or wish to provide further details, please post there.
Afrosheen
Getting the hang of things
Posts: 90
Joined: Tue Dec 23, 2014 3:51 pm

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by Afrosheen »

I was able to address this by uninstalling beets and deleting the data folder where the database files were being stored (the directory is set in your config.yaml), then reinstalled it. I was able to get beets working after that.
User avatar
peelos
Been there, done that
Posts: 580
Joined: Sun Jun 26, 2016 9:28 pm

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by peelos »

Thanks, did you then specify a new directory for the database files?
NAS: TVS-1282-i7-7700-40G / 4 x 500GB SSD 2.5" RAID 10 / 2 x 500GB M.2 SSD / 8 x 12TB WD Whites 3.5" RAID 6 / Noctua L9x65 / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU
Software: Plex Media Server / Transmission / Sonarr / Radarr / Bazarr / Jackett / Tautulli / Home Assistant / Resilio Sync / Python / NetData / SortMyQPKGs
pfSense Firewall / OpenVPN Server: QOTOM Fanless Mini PC / Core i5 / 8GB RAM / 128GB SSD / 4 Gigabit NICs / AES-NI
Wireless Routers: 2 x Netgear AC1900 R7000 Nighthawk / 1 x Netgear AC3200 R8000 Nighthawk / FreshTomato Firmware
Afrosheen
Getting the hang of things
Posts: 90
Joined: Tue Dec 23, 2014 3:51 pm

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by Afrosheen »

I did not need to set a new directory from what I had set originally in config.yaml. It was originally set at "/root/.config/beets/".

What I did was I first uninstalled beets then deleted the directory, "/beets" and everything inside it. Then reinstalled it and ran the import command again on the same directory of music that I was previously having trouble and it was able to import the specific directory that previously would lead to the error above.
milkman dan
New here
Posts: 2
Joined: Thu May 04, 2017 4:21 am

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by milkman dan »

I am trying to get beets set up on my TS-251. I think I am very close but must be missing something silly. I got pip installed correctly from what I can tell and pip install beets did its thing. When I "pip list" I see beets and all that. I created my config.yaml, but when I try beet import it tells me that "-sh: beet: command not found"

Can I provide any additional details to get some help resolving this? Thanks so much!
User avatar
peelos
Been there, done that
Posts: 580
Joined: Sun Jun 26, 2016 9:28 pm

Re: [Beets] OCD Music Geek Power Tool for QNAP NAS

Post by peelos »

now we have a qpkg: viewtopic.php?f=320&t=144575
NAS: TVS-1282-i7-7700-40G / 4 x 500GB SSD 2.5" RAID 10 / 2 x 500GB M.2 SSD / 8 x 12TB WD Whites 3.5" RAID 6 / Noctua L9x65 / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU
Software: Plex Media Server / Transmission / Sonarr / Radarr / Bazarr / Jackett / Tautulli / Home Assistant / Resilio Sync / Python / NetData / SortMyQPKGs
pfSense Firewall / OpenVPN Server: QOTOM Fanless Mini PC / Core i5 / 8GB RAM / 128GB SSD / 4 Gigabit NICs / AES-NI
Wireless Routers: 2 x Netgear AC1900 R7000 Nighthawk / 1 x Netgear AC3200 R8000 Nighthawk / FreshTomato Firmware
Post Reply

Return to “Community Apps”