(media)
return Status.SUCCESS
Process a non-media file: copy and create thumbnail.
Process a non-media file: copy and create thumbnail.
Process a non - media file : copy and create thumbnail .
def process_nonmedia(media):
    """Process a non-media file: copy and create thumbnail."""
    logger.info('Processing non-media file: %s', media.dst_filename)
    settings = media.settings
    plugin_settings = settings.get('nonmedia_files_options', {})

    try:
        utils.copy(media.src_path, media.dst_path, symlink=settings['orig_link'])
    except Exception:
        if logger.getEffectiveLevel() == logging.DEBUG:
            raise
        else:
            return Status.FAILURE

    if plugin_settings.get('ext_as_thumb', DEFAULT_CONFIG['ext_as_thumb']):
        logger.info('plugin_settings: %r', plugin_settings)
        try:
            kwargs = {}
            if plugin_settings.get('thumb_font', None):
                kwargs['font'] = plugin_settings['thumb_font']
            if plugin_settings.get('thumb_bg_color', None):
                kwargs['bg_color'] = plugin_settings['thumb_bg_color']
            if plugin_settings.get('thumb_font_color', None):
                kwargs['font_color'] = plugin_settings['thumb_font_color']
            generate_thumbnail(
                media.src_ext[1:].upper(),
                media.thumb_path,
                settings['thumb_size'],
                options=settings['jpg_options'],
                **kwargs,
            )
        except Exception:
            if logger.getEffectiveLevel() == logging.DEBUG:
                raise
            else:
                return Status.FAILURE
    return Status.SUCCESS
def process_nonmedia ( media ) : logger . info ( 'Processing non-media file: %s' , media . dst_filename ) settings = media . settings plugin_settings = settings . get ( 'nonmedia_files_options' , { } ) try : utils . copy ( media . src_path , media . dst_path , symlink = settings [ 'orig_link' ] ) except Exception : if logger . getEffectiveLevel ( ) == logging . DEBUG : raise else : return Status . FAILURE if plugin_settings . get ( 'ext_as_thumb' , DEFAULT_CONFIG [ 'ext_as_thumb' ] ) : logger . info ( 'plugin_settings: %r' , plugin_settings ) try : kwargs = { } if plugin_settings . get ( 'thumb_font' , None ) : kwargs [ 'font' ] = plugin_settings [ 'thumb_font' ] if plugin_settings . get ( 'thumb_bg_color' , None ) : kwargs [ 'bg_color' ] = plugin_settings [ 'thumb_bg_color' ] if plugin_settings . get ( 'thumb_font_color' , None ) : kwargs [ 'font_color' ] = plugin_settings [ 'thumb_font_color' ] generate_thumbnail ( media . src_ext [ 1 : ] . upper ( ) , media . thumb_path , settings [ 'thumb_size' ] , options = settings [ 'jpg_options' ] , * * kwargs , ) except Exception : if logger . getEffectiveLevel ( ) == logging . DEBUG : raise else : return Status . FAILURE return Status . SUCCESS