def write_items(lib, query, pretend, force):
 (items, albums) = _do_query(lib, query, False, False)
 for item in items:
  if (not os.path.exists(syspath(item.path))):
   log.info(u'missing file: {0}'.format(util.displayable_path(item.path)))
   continue
  try:
   clean_item = library.Item.from_path(item.path)
  except library.ReadError as exc:
   log.error(u'error reading {0}: {1}'.format(displayable_path(item.path), exc))
   continue
  changed = ui.show_model_changes(item, clean_item, library.Item._media_fields, force)
  if ((changed or force) and (not pretend)):
   item.try_sync()

def write_items ( lib , query , pretend , force ) : ( items , albums ) = _do_query ( lib , query , False , False ) for item in items : if ( not os . path . exists ( syspath ( item . path ) ) ) : log . info ( u'missing file: {0}' . format ( util . displayable_path ( item . path ) ) ) continue try : clean_item = library . Item . from_path ( item . path ) except library . ReadError as exc : log . error ( u'error reading {0}: {1}' . format ( displayable_path ( item . path ) , exc ) ) continue changed = ui . show_model_changes ( item , clean_item , library . Item . _media_fields , force ) if ( ( changed or force ) and ( not pretend ) ) : item . try_sync ( )
write tag information from the database to the respective files in the filesystem .