Ejemplo n.º 1
0
def movie_dialog(data, imdb_id=None, strm=False):
    dialog = xbmcgui.Dialog()
    open_playlists = dialog.yesno("Seach alternatives", "What search routine should be done?",
                    "Regular search: Slow, but finds all results.",
                    "Fast search: Fast but finds less files.",
                    "Fast search", "Regular search")
    
    files = search(data, limit='25')

    pDialog = xbmcgui.DialogProgress()
    pDialog.create('Searching for files')
        
    tracks = []
    count = 0
    for f in files:
        count = count + 1
        percent = int(float(count * 100) / len(files))
        text = "%s files found" % len(tracks)
        pDialog.update(percent, text)
        if f.type == "video":
            new_tracks = get_playlist_tracks(f, open_playlists=open_playlists)
            tracks.extend(new_tracks)

    (url, name) = track_dialog(tracks)
    
    if not url or not name:
        if strm:
            set_resolved_to_dummy()
        return
    
    li = xbmcgui.ListItem(clean_file_name(data))
    li = set_movie_meta(li, imdb_id, META_PATH)
    execute_video(name, url, li, strm)
Ejemplo n.º 2
0
def create_item_tuple(name, mode, data="", imdb_id="", isFolder=True, isSubscribable=False, isMovieItem=False, isTVShowItem=False):
    url = create_url(name, mode, data, imdb_id)
    li = create_list_item(name, mode, isSubscribable=isSubscribable, isMovieItem=isMovieItem, isTVShowItem=isTVShowItem, imdb_id=imdb_id)
    if not imdb_id == "":
        if isMovieItem:
            li = set_movie_meta(li, imdb_id, META_PATH)
        if isTVShowItem:
            li = set_tv_show_meta(li, imdb_id, META_PATH)
    return (url, li, isFolder)