clerk icon indicating copy to clipboard operation
clerk copied to clipboard

Error output to file?

Open hgvhgv opened this issue 7 years ago • 2 comments

When I hit enter on an album or track, in order to add to queue, a bunch of errors show up, before the next add,replace,etc. screen shows up quickly, disappearing the errors. I'm pretty sure this means there are missing tags, but I'd like to know which tags. I've opened some of those files in Picard, and it seems as if no tags are missing. Is there any way to pipe the error output to a file or view it in Clerk?

hgvhgv avatar Feb 07 '19 02:02 hgvhgv

I have a script to check for missing tags: Just check for artist, albumartist, date, track, title, album But yes, I should make the warnings output to stdout and format them properly.

#!/usr/bin/env python3

from mpd import MPDClient
import os

client = MPDClient()

mpd_host = 'localhost'
mpd_port = '6600'
mpd_pass = ''

if 'MPD_HOST' in os.environ:
    mpd_connection = os.environ['MPD_HOST'].split('@')
    if len(mpd_connection) == 1:
        mpd_host = mpd_connection[0]
    elif len(mpd_connection) == 2:
        mpd_host = mpd_connection[1]
        mpd_pass = mpd_connection[0]
    else:
        print('Unable to parse MPD_HOST, using defaults')

if 'MPD_PORT' in os.environ:
    mpd_port = os.environ['MPD_PORT']

client.connect(mpd_host, mpd_port)
if mpd_pass:
    client.password(mpd_pass)

search=input("Which tag to search for? > ")
tagpool=client.search('filename', '')

for tag in tagpool:
    newpool=[]
    if 'directory' not in tag:
        if search not in tag:
            newpool.append(tag)
    for entry in newpool:
        if 'file' in entry:
            print(entry['file'])

carnager avatar Feb 07 '19 05:02 carnager

Thanks! I have a lot of work to do in terms of cleaning tags. Up to you if you want to keep this open for the error output enhancement.

hgvhgv avatar Feb 07 '19 14:02 hgvhgv