[QUOTE=chaley;4524192]
Code:
python:
def evaluate(book, context):
import os
from calibre.library import current_library_path
fmt_metadata = book.get('format_metadata')
if fmt_metadata:
for v in fmt_metadata.values():
# A calibre format name is three section, author, title, format.extension
# We want to return author/format without the extension
p = v['path']
r,f = os.path.split(p)
format = os.path.splitext(f)[0]
r,title = os.path.split(r)
r,author = os.path.split(r)
return '/'.join((author, format))
else:
return 'title - author'
your code works well also! Thank you for your help.