Ejemplo n.º 1
0
def itemify_file(f, **kwargs):
    """
    :type f: File
    """
    item = {
        'label': tf.file_title(f),
        'context_menu':
            refresh_context_menu(f.media_id) +
            toggle_watched_context_menu() +
            download_torrent_context_menu(f.link),
        'is_playable': True,
        'stream_info': [('video', {
            'codec': f.file_format,
            'width': f.resolution[0],
            'height': f.resolution[1],
            'duration': f.duration,
        })],
        'path': plugin.url_for('play_file', section=f.section.filter_val, media_id=f.media_id,
                               url=f.link, title=f.title, **kwargs)
    }
    return with_fanart(item)
Ejemplo n.º 2
0
def itemify_folder(f):
    """
    :type f: Folder
    :rtype: dict
    """
    item = {
        'label': tf.folder_title(f),
        'path': plugin.url_for('show_files', section=f.section.filter_val, media_id=f.media_id, folder_id=f.id),
        'context_menu':
            refresh_context_menu(f.media_id) +
            download_torrent_context_menu(f.link) +
            library_context_menu(f.section, f.media_id, f.id),
        'info': {
            'size': f.size,
        },
        'stream_info': {
            'video': {
                'width': f.fmt.width,
                'height': f.fmt.height,
            },
        }
    }
    return with_fanart(item)