From c20e6d618c931cd3002a9afad5ee32f8e4135bdb Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Sat, 19 Mar 2022 18:52:59 -0400 Subject: [PATCH] [13] move sort back to right after collection --- .github/workflows/commit.yml | 6 +++--- .github/workflows/release.yml | 2 +- .github/workflows/version.yml | 2 +- VERSION | 2 +- modules/cache.py | 15 ++++++++------- modules/library.py | 1 - plex_meta_manager.py | 14 ++------------ 7 files changed, 16 insertions(+), 26 deletions(-) diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index cb11ac2f..a99093b9 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -6,12 +6,12 @@ on: jobs: - release: + commit-notification: runs-on: ubuntu-latest steps: - - name: Send Discord Release Notification + - name: Send Discord Commit Notification uses: meisnate12/discord-notifications@master with: webhook_id: ${{ secrets.DEVELOP_WEBHOOK_ID }} @@ -19,4 +19,4 @@ jobs: title: Plex Meta Manager Develop Push commits: "true" username: PMM Develop - avatar_url: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager/master/.github/pmm.png \ No newline at end of file + avatar_url: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager/develop/.github/pmm.png \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13fd72ea..a115646e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: jobs: - release: + release-notification: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index c38d9837..d2b5f1df 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -7,7 +7,7 @@ on: jobs: - docker-develop: + docker-version: runs-on: ubuntu-latest steps: diff --git a/VERSION b/VERSION index 4fd70d2f..bcf747a1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.2-develop12 +1.16.2-develop13 diff --git a/modules/cache.py b/modules/cache.py index 2b9f173b..24c18fce 100644 --- a/modules/cache.py +++ b/modules/cache.py @@ -373,9 +373,9 @@ class Cache: "imdb_rating = ?, imdb_votes = ?, metacritic_rating = ?, type = ?, series_id = ?, " \ "season_num = ?, episode_num = ?, expiration_date = ? WHERE imdb_id = ?" cursor.execute(update_sql, ( - omdb.title, omdb.year, omdb.released.strftime("%d %b %Y"), omdb.content_rating, omdb.genres_str, - omdb.imdb_rating, omdb.imdb_votes, omdb.metacritic_rating, omdb.type, omdb.series_id, omdb.season_num, - omdb.episode_num, expiration_date.strftime("%Y-%m-%d"), omdb.imdb_id)) + omdb.title, omdb.year, omdb.released.strftime("%d %b %Y") if omdb.released else None, omdb.content_rating, + omdb.genres_str, omdb.imdb_rating, omdb.imdb_votes, omdb.metacritic_rating, omdb.type, omdb.series_id, + omdb.season_num, omdb.episode_num, expiration_date.strftime("%Y-%m-%d"), omdb.imdb_id)) def query_mdb(self, key_id, expiration): mdb_dict = {} @@ -422,10 +422,11 @@ class Cache: "trakt_rating = ?, tomatoes_rating = ?, tomatoesaudience_rating = ?, tmdb_rating = ?, " \ "letterboxd_rating = ?, certification = ?, commonsense = ?, expiration_date = ? WHERE key_id = ?" cursor.execute(update_sql, ( - mdb.title, mdb.year, mdb.released.strftime("%Y-%m-%d"), mdb.type, mdb.imdbid, mdb.traktid, mdb.tmdbid, - mdb.score, mdb.imdb_rating, mdb.metacritic_rating, mdb.metacriticuser_rating, mdb.trakt_rating, - mdb.tomatoes_rating, mdb.tomatoesaudience_rating, mdb.tmdb_rating, mdb.letterboxd_rating, - mdb.content_rating, mdb.commonsense, expiration_date.strftime("%Y-%m-%d"), key_id + mdb.title, mdb.year, mdb.released.strftime("%Y-%m-%d") if mdb.released else None, mdb.type, + mdb.imdbid, mdb.traktid, mdb.tmdbid, mdb.score, mdb.imdb_rating, mdb.metacritic_rating, + mdb.metacriticuser_rating, mdb.trakt_rating, mdb.tomatoes_rating, mdb.tomatoesaudience_rating, + mdb.tmdb_rating, mdb.letterboxd_rating, mdb.content_rating, mdb.commonsense, + expiration_date.strftime("%Y-%m-%d"), key_id )) def query_tmdb_movie(self, tmdb_id, expiration): diff --git a/modules/library.py b/modules/library.py index a4be913d..0cfb4cb5 100644 --- a/modules/library.py +++ b/modules/library.py @@ -28,7 +28,6 @@ class Library(ABC): self.movie_rating_key_map = {} self.show_rating_key_map = {} self.run_again = [] - self.run_sort = [] self.overlays = [] self.type = "" self.config = config diff --git a/plex_meta_manager.py b/plex_meta_manager.py index 6558f30c..cae87b82 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -277,15 +277,6 @@ def update_libraries(config): logger.remove_library_handler(library.mapping_name) run_collection(config, library, metadata, collections_to_run) logger.re_add_library_handler(library.mapping_name) - if library.run_sort: - logger.info("") - logger.separator(f"Sorting {library.name} Library's Collections", space=False, border=False) - logger.info("") - for builder in library.run_sort: - logger.info("") - logger.separator(f"Sorting {builder.name} Collection", space=False, border=False) - logger.info("") - builder.sort_collection() if not config.library_first and library.library_operation and not config.test_mode and not collection_only: library_operations(config, library) @@ -671,7 +662,7 @@ def library_operations(config, library): if omdb_item and library.mass_content_rating_update == "omdb": new_rating = omdb_item.content_rating elif mdb_item and library.mass_content_rating_update == "mdb": - new_rating = mdb_item.certification if mdb_item.certification else None + new_rating = mdb_item.content_rating if mdb_item.content_rating else None elif mdb_item and library.mass_content_rating_update == "mdb_commonsense": new_rating = mdb_item.commonsense if mdb_item.commonsense else None else: @@ -995,8 +986,7 @@ def run_collection(config, library, metadata, requested_collections): if builder.item_details: builder.update_item_details() if builder.custom_sort: - library.run_sort.append(builder) - # builder.sort_collection() + builder.sort_collection() builder.send_notifications()