plugin paths:
Sending event: pluginload
inline: adding item field multidisc
inline: adding album field format
library database: D:\Music\musiclibrary.db
library directory: D:\Music
Sending event: library_opened
Sending event: import_begin
Sending event: import_task_created
D:\Music\Artists\A\amazarashi\Sora ni Utaeba
Replacing item 584: D:\Music\Artists\A\amazarashi\Sora ni Utaeba\01 - Sora ni Utaeba.flac
Sending event: database_change
Sending event: item_removed
Replacing item 585: D:\Music\Artists\A\amazarashi\Sora ni Utaeba\02 - Gekkou, Machi wo Yaku.flac
Sending event: database_change
Sending event: item_removed
Replacing item 586: D:\Music\Artists\A\amazarashi\Sora ni Utaeba\03 - Tarareba.flac
Sending event: database_change
Sending event: item_removed
Replacing item 587: D:\Music\Artists\A\amazarashi\Sora ni Utaeba\04 - Tarareba -acoustic ver.-.flac
Sending event: database_change
Sending event: item_removed
Replacing item 588: D:\Music\Artists\A\amazarashi\Sora ni Utaeba\05 - Sora ni Utaeba -instrumental-.flac
Sending event: database_change
Sending event: database_change
Sending event: item_removed
5 of 5 items replaced
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Reimported album: added 1505278679.94, flexible attributes [] from album 85 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba
Reimported item added 1505278679.94 from item 584 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba\01 - Sora ni Utaeba.flac
Reimported item flexible attributes [u'source', u'sourcerelation'] from item 584 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba\01 - Sora ni Utaeba.flac
Sending event: database_change
Reimported item added 1505278679.94 from item 585 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba\02 - Gekkou, Machi wo Yaku.flac
Reimported item flexible attributes [] from item 585 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba\02 - Gekkou, Machi wo Yaku.flac
Sending event: database_change
Reimported item added 1505278679.94 from item 586 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba\03 - Tarareba.flac
Reimported item flexible attributes [] from item 586 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba\03 - Tarareba.flac
Sending event: database_change
Reimported item added 1505278679.94 from item 587 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba\04 - Tarareba -acoustic ver.-.flac
Reimported item flexible attributes [] from item 587 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba\04 - Tarareba -acoustic ver.-.flac
Sending event: database_change
Reimported item added 1505278679.94 from item 588 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba\05 - Sora ni Utaeba -instrumental-.flac
Reimported item flexible attributes [u'source', u'sourcerelation'] from item 588 for D:\Music\Artists\A\amazarashi\Sora ni Utaeba\05 - Sora ni Utaeba -instrumental-.flac
Sending event: database_change
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "c:\python27\scripts\beet.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\beets\ui\__init__.py", line 1256, in main
_raw_main(args)
File "c:\python27\lib\site-packages\beets\ui\__init__.py", line 1243, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "c:\python27\lib\site-packages\beets\ui\commands.py", line 934, in import_func
import_files(lib, paths, query)
File "c:\python27\lib\site-packages\beets\ui\commands.py", line 911, in import_files
session.run()
File "c:\python27\lib\site-packages\beets\importer.py", line 325, in run
pl.run_parallel(QUEUE_SIZE)
File "c:\python27\lib\site-packages\beets\util\pipeline.py", line 445, in run_parallel
six.reraise(exc_info[0], exc_info[1], exc_info[2])
File "c:\python27\lib\site-packages\beets\util\pipeline.py", line 312, in run
out = self.coro.send(msg)
File "c:\python27\lib\site-packages\beets\util\pipeline.py", line 194, in coro
func(*(args + (task,)))
File "c:\python27\lib\site-packages\beets\importer.py", line 1435, in plugin_stage
func(session, task)
File "c:\python27\lib\site-packages\beets\plugins.py", line 118, in wrapper
assert self._log.level == logging.NOTSET
AttributeError: 'CustomFields' object has no attribute '_log'
Here’s the traceback. I was able to fix the import_stages error by adding a lie to the plugin.
Here’s the current state of the plugin:
from beets import plugins, mediafile
class CustomFields(plugins.BeetsPlugin):
def __init__(self):
field = mediafile.MediaField(
mediafile.MP3DescStorageStyle(u'Source'),
mediafile.StorageStyle(u'SOURCE')
)
field2 = mediafile.MediaField(
mediafile.MP3DescStorageStyle(u'SourceRelation'),
mediafile.StorageStyle(u'SOURCERELATION')
)
self.add_media_field('source', field)
self.add_media_field('sourcerelation', field2)
self.import_stages = [self.stage]
def stage(self, session, task):
print('Importing something!')
Here’s the log for what happens when I search for the field:
beet -v -v ls source:Absolute
user configuration: C:\Users\REDACTED\AppData\Roaming\beets\config.yaml
data directory: C:\Users\REDACTED\AppData\Roaming\beets
plugin paths:
Sending event: pluginload
inline: adding item field multidisc
inline: adding album field format
library database: D:\Music\musiclibrary.db
library directory: D:\Music
Sending event: library_opened
Sending event: cli_exit
I have a file with the Source field populated by “Absolute Duo”