예제 #1
0
    def start(self, hidden=False):
        if hidden:
            global HIDE_TOP250
            HIDE_TOP250 = True

        if HIDE_TOP250:
            util.notification(l("Importing_current_IMDb_Top250"))
        else:
            self.progress = util.dialogProgress()
            self.progress.update(0, l("Importing_current_IMDb_Top250"))

        self.top250 = self.getTop250()
        self.notMissing = set()

        if self.top250 == {}:
            util.dialogOk(l("Top250"), l("There_was_a_problem_with_the_IMDb_site!"))
        else:
            movies = util.getMoviesWith('imdbnumber', 'top250')
            length = len(movies)
            if length > 0:
                self.startProcess(movies, length)
            else:
                util.dialogOk(l("Info"), l("The_video_library_is_empty_or_the_IMDb_id_doesn't_exist!"))

        if not(HIDE_TOP250):
            self.progress.close()

        return HIDE_TOP250
예제 #2
0
    def start(self, hidden=False):
        if hidden:
            global HIDE_TOP250
            HIDE_TOP250 = True

        if HIDE_TOP250:
            util.notification(l("Importing_current_IMDb_Top250"))
        else:
            self.progress = util.dialogProgress()
            self.progress.update(0, l("Importing_current_IMDb_Top250"))

        self.top250 = self.getTop250()
        self.notMissing = set()

        if self.top250 == {}:
            util.dialogOk(l("Top250"),
                          l("There_was_a_problem_with_the_IMDb_site!"))
        else:
            movies = util.getMoviesWith('imdbnumber', 'top250')
            length = len(movies)
            if length > 0:
                self.startProcess(movies, length)
            else:
                util.dialogOk(
                    l("Info"),
                    l("The_video_library_is_empty_or_the_IMDb_id_doesn't_exist!"
                      ))

        if not (HIDE_TOP250):
            self.progress.close()

        return HIDE_TOP250
예제 #3
0
    def startProcess(self, movies, total):
        updated = 0
        resume = self.getResume()

        if HIDE_MOVIES:
            util.notification(util.l("Started_updating_movies_ratings"))
        else:
            progress = util.dialogProgress()

        for count, movie in enumerate(movies):
            if util.abortRequested() or (not(HIDE_MOVIES) and progress.iscanceled()):
                self.writeResume(count)
                break
            if count >= resume:
                if not(HIDE_MOVIES):
                    progress.update((count * 100) // total, "%s %s" % (util.l("Searching_for"), movie["label"]))
                updated += self.updateMovie(movie)
        else:
            util.deleteF("resume_movies")
            util.writeDate("movies")

        text = "%s: %s %s %s %s!" % (util.l("Movies_ratings_summary"), updated, util.l("of"), total, util.l("were_updated"))
        util.log(text)

        if HIDE_MOVIES:
            util.notification(text)
        else:
            progress.close()
            util.dialogOk(util.l("Completed"), text)
예제 #4
0
    def startProcess(self, movies, total):
        global FORM_MPAA
        updated = 0

        if HIDE_MPAA:
            util.notification(l("Started_updating_movies_ratings"))
        else:
            progress = util.dialogProgress()

        website = "altersfreigaben.de"
        if LANG_MPAA == "de":
            if not CHANGED_PREFIX:
                FORM_MPAA = "germany:"
        if LANG_MPAA == "us":
            if not CHANGED_PREFIX:
                FORM_MPAA = "Rated"
        if LANG_MPAA == "au":
            if not CHANGED_PREFIX:
                FORM_MPAA = "australia:"
        if LANG_MPAA == "nl":
            if not CHANGED_PREFIX:
                FORM_MPAA = "Rated"

        httphandler = httplib.HTTPConnection(website)

        for count, movie in enumerate(movies):
            if util.abortRequested() or (not (HIDE_MPAA)
                                         and progress.iscanceled()):
                break

            if not (HIDE_MPAA):
                progress.update((count * 100) // total,
                                "%s %s" % (l("Searching_for"), movie["label"]))

            updated += self.updateMovie(movie, httphandler, LANG_MPAA)
        else:
            util.writeDate("mpaa")

        text = "%s: %s %s %s %s!" % (l("Movies_ratings_summary"), updated,
                                     l("of"), total, l("were_updated"))
        util.log(text)

        if HIDE_MPAA:
            util.notification(text)
        else:
            progress.close()
            util.dialogOk(l("Completed"), text)
예제 #5
0
    def startProcess(self, movies, total):
        global FORM_MPAA
        updated = 0

        if HIDE_MPAA:
            util.notification(l("Started_updating_movies_ratings"))
        else:
            progress = util.dialogProgress()

        website = "altersfreigaben.de"
        if LANG_MPAA == "de":
            if not CHANGED_PREFIX:
               FORM_MPAA = "germany:"
        if LANG_MPAA == "us":
            if not CHANGED_PREFIX:
               FORM_MPAA = "Rated"
        if LANG_MPAA == "au":
            if not CHANGED_PREFIX:
               FORM_MPAA = "australia:"
        if LANG_MPAA == "nl":
            if not CHANGED_PREFIX:
               FORM_MPAA = "Rated"

        httphandler = httplib.HTTPConnection(website)

        for count, movie in enumerate(movies):
            if util.abortRequested() or (not(HIDE_MPAA) and progress.iscanceled()):
                break

            if not(HIDE_MPAA):
                progress.update((count * 100) // total, "%s %s" % (l("Searching_for"), movie["label"]))

            updated += self.updateMovie(movie, httphandler, LANG_MPAA)
        else:
            util.writeDate("mpaa")

        text = "%s: %s %s %s %s!" % (l("Movies_ratings_summary"), updated, l("of"), total, l("were_updated"))
        util.log(text)

        if HIDE_MPAA:
            util.notification(text)
        else:
            progress.close()
            util.dialogOk(l("Completed"), text)