Пример #1
0
def history_index(section):
    plugin.set_content("movies")
    section = Section.find(section)
    history = container.history()
    items = []
    for item in reversed(history.get(section)):
        items.append(
            {
                "label": item.title,
                "thumbnail": item.poster,
                "path": item.path,
                "is_playable": True,
                "context_menu": toggle_watched_context_menu()
                + bookmark_context_menu(item.media_id, item.section, item.title)
                + download_torrent_context_menu(item.url)
                + clear_history_context_menu(),
            }
        )
    return with_fanart(items)
Пример #2
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)
Пример #3
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)