From 2c579c0a54cec3bee1ad1414e2314dc673ed9c6c Mon Sep 17 00:00:00 2001 From: Sam Chau Date: Sun, 1 Dec 2024 17:15:45 +1030 Subject: [PATCH] chore: remove deprecated database files / scripts / workflows --- .github/workflows/add-issue-to-project.yml | 129 -- .github/workflows/new-branch-created.yml | 114 -- .github/workflows/sync.yml | 28 - .github/workflows/test.yml | 27 - db/custom_formats/audio/ATMOS (Missing).json | 69 - db/custom_formats/audio/ATMOS.json | 27 - db/custom_formats/audio/DD+.json | 132 -- db/custom_formats/audio/DD.json | 153 -- db/custom_formats/audio/DTS-HD MA.json | 195 -- db/custom_formats/audio/DTS-X.json | 174 -- db/custom_formats/audio/DTS.json | 216 --- db/custom_formats/audio/FLAC.json | 153 -- db/custom_formats/audio/PCM.json | 153 -- db/custom_formats/audio/TrueHD (Missing).json | 202 -- db/custom_formats/audio/TrueHD.json | 111 -- db/custom_formats/codec/2160p x265.json | 111 -- db/custom_formats/codec/AV1.json | 27 - db/custom_formats/codec/Blu-Ray (Remux).json | 109 -- db/custom_formats/codec/DVD REMUX .json | 109 -- db/custom_formats/codec/REMUX.json | 109 -- db/custom_formats/codec/VVC.json | 27 - db/custom_formats/codec/WEBRip.json | 109 -- db/custom_formats/codec/Xvid.json | 27 - db/custom_formats/codec/h265 (4k).json | 200 -- db/custom_formats/codec/h265.json | 242 --- db/custom_formats/codec/x264.json | 172 -- db/custom_formats/codec/x265 (Missing).json | 109 -- db/custom_formats/codec/x265 (Web).json | 151 -- db/custom_formats/codec/x265.json | 151 -- db/custom_formats/flag/Freeleech100.json | 82 - db/custom_formats/flag/Freeleech25.json | 82 - db/custom_formats/flag/Freeleech50.json | 82 - db/custom_formats/flag/Freeleech75.json | 82 - .../flag/Golden Popcorn 1080p.json | 152 -- .../flag/Golden Popcorn 720p.json | 152 -- db/custom_formats/flag/Golden Popcorn SD.json | 222 --- db/custom_formats/flag/HDBits Internal.json | 1636 ---------------- db/custom_formats/group/3L.json | 27 - db/custom_formats/group/AnoZu.json | 27 - .../group/BHDStudio (1080p x265).json | 48 - db/custom_formats/group/BHDStudio.json | 27 - db/custom_formats/group/BLURANiUM.json | 27 - db/custom_formats/group/BMF.json | 27 - db/custom_formats/group/BV.json | 27 - db/custom_formats/group/BeyondHD.json | 27 - db/custom_formats/group/CRX.json | 27 - db/custom_formats/group/CRiSC.json | 27 - db/custom_formats/group/Chivaman.json | 27 - db/custom_formats/group/Chotab.json | 27 - db/custom_formats/group/CtrlHD.json | 27 - db/custom_formats/group/D-Z0N3.json | 27 - db/custom_formats/group/DON.json | 109 -- db/custom_formats/group/Dariush .json | 109 -- db/custom_formats/group/Dariush SD.json | 109 -- db/custom_formats/group/E.N.D.json | 27 - db/custom_formats/group/E1.json | 27 - db/custom_formats/group/EA.json | 27 - db/custom_formats/group/EDPH.json | 27 - db/custom_formats/group/EPSiLON.json | 27 - db/custom_formats/group/ESiR.json | 27 - db/custom_formats/group/EXCiSiON.json | 27 - db/custom_formats/group/EbP.json | 27 - db/custom_formats/group/FTW-HD.json | 27 - db/custom_formats/group/FoRM.json | 27 - db/custom_formats/group/FraMeSToR.json | 48 - db/custom_formats/group/GALAXY.json | 27 - db/custom_formats/group/GRiMM.json | 109 -- db/custom_formats/group/GS88.json | 27 - db/custom_formats/group/Geek.json | 27 - db/custom_formats/group/GutS.json | 27 - db/custom_formats/group/HANDJOB SD.json | 109 -- db/custom_formats/group/HANDJOB.json | 109 -- db/custom_formats/group/HDMaNiAcS.json | 27 - db/custom_formats/group/HONE.json | 109 -- db/custom_formats/group/HiDt.json | 27 - db/custom_formats/group/HiFi.json | 27 - db/custom_formats/group/HiP.json | 27 - db/custom_formats/group/IDE.json | 27 - db/custom_formats/group/KASHMiR.json | 27 - db/custom_formats/group/LEGi0N (x265).json | 48 - db/custom_formats/group/LEGi0N.json | 27 - db/custom_formats/group/LSt.json | 27 - db/custom_formats/group/LoRD.json | 27 - db/custom_formats/group/LolHD.json | 27 - db/custom_formats/group/MTeam.json | 27 - db/custom_formats/group/MainFrame.json | 27 - db/custom_formats/group/NAN0.json | 27 - db/custom_formats/group/NCmt.json | 27 - db/custom_formats/group/NTb.json | 109 -- db/custom_formats/group/NyHD.json | 27 - db/custom_formats/group/ORiGEN.json | 27 - db/custom_formats/group/PTer.json | 27 - db/custom_formats/group/Penumbra.json | 27 - db/custom_formats/group/PmP.json | 27 - db/custom_formats/group/Positive.json | 27 - db/custom_formats/group/QxR.json | 132 -- db/custom_formats/group/R1GY3B B3YG1R.json | 27 - db/custom_formats/group/Ralphy.json | 48 - db/custom_formats/group/RightSIZE.json | 27 - db/custom_formats/group/SA89.json | 27 - db/custom_formats/group/SEV.json | 111 -- db/custom_formats/group/SaNcTi.json | 27 - db/custom_formats/group/SbR.json | 27 - db/custom_formats/group/Scene.json | 256 --- db/custom_formats/group/SiMPLE.json | 27 - db/custom_formats/group/TAoE.json | 69 - db/custom_formats/group/TBB SD.json | 109 -- db/custom_formats/group/TBB.json | 109 -- db/custom_formats/group/TDD.json | 27 - db/custom_formats/group/TRiToN.json | 27 - db/custom_formats/group/TayTo.json | 27 - db/custom_formats/group/ThD.json | 27 - db/custom_formats/group/TimeDistortion.json | 27 - .../group/Unwanted x265 Groups.json | 27 - db/custom_formats/group/VietHD.json | 27 - db/custom_formats/group/Vyndros.json | 27 - db/custom_formats/group/W4NK3R.json | 27 - db/custom_formats/group/WMING.json | 27 - db/custom_formats/group/WiLDCAT.json | 27 - db/custom_formats/group/ZIMBO.json | 27 - db/custom_formats/group/ZQ.json | 27 - db/custom_formats/group/c0ke.json | 27 - db/custom_formats/group/de[42].json | 27 - db/custom_formats/group/decibeL.json | 27 - db/custom_formats/group/dkore.json | 27 - db/custom_formats/group/edge2020.json | 27 - db/custom_formats/group/iFT.json | 27 - db/custom_formats/group/jennaortegaUHD.json | 27 - db/custom_formats/group/luvBB.json | 27 - db/custom_formats/group/mHD.json | 27 - db/custom_formats/group/nmd.json | 27 - db/custom_formats/group/playBD.json | 27 - db/custom_formats/group/playHD.json | 27 - db/custom_formats/group/xander.json | 27 - .../hdr/Dolby Vision wout Fallback.json | 27 - db/custom_formats/hdr/Dolby Vision.json | 69 - .../hdr/HDR10 (Missing) (x265 HDR only).json | 132 -- db/custom_formats/hdr/HDR10 (Missing).json | 160 -- db/custom_formats/hdr/HDR10+.json | 90 - db/custom_formats/hdr/HDR10.json | 111 -- db/custom_formats/other/3D.json | 69 - db/custom_formats/other/Black and White.json | 27 - db/custom_formats/other/DVD.json | 109 -- db/custom_formats/other/Disc .json | 48 - db/custom_formats/other/Extras.json | 27 - db/custom_formats/other/IMAX.json | 48 - db/custom_formats/other/LQ.json | 1707 ----------------- db/custom_formats/other/Stream Optimised.json | 27 - db/custom_formats/other/UHDBits.json | 27 - db/custom_formats/other/Upscaled.json | 27 - db/custom_formats/resolution/1080p.json | 90 - db/custom_formats/resolution/2160p.json | 90 - db/custom_formats/resolution/480p.json | 146 -- db/custom_formats/resolution/720p.json | 90 - db/custom_formats/resolution/Unwanted.json | 368 ---- db/custom_formats/source/Blu-Ray.json | 109 -- db/custom_formats/source/UHD Bluray.json | 48 - db/custom_formats/streaming/7PLUS.json | 112 -- db/custom_formats/streaming/Amazon Prime.json | 109 -- db/custom_formats/streaming/Apple TV+.json | 109 -- db/custom_formats/streaming/Disney+.json | 109 -- db/custom_formats/streaming/HBO Max.json | 109 -- db/custom_formats/streaming/Hulu.json | 109 -- db/custom_formats/streaming/MAX.json | 191 -- .../streaming/Movies Anywhere.json | 130 -- db/custom_formats/streaming/Netflix.json | 109 -- db/custom_formats/streaming/Paramount+.json | 109 -- db/custom_formats/streaming/Peacock TV.json | 109 -- db/custom_formats/streaming/ROKU.json | 109 -- .../streaming/iTunes (Missing).json | 422 ---- db/custom_formats/streaming/iTunes.json | 191 -- db/quality_profiles/1080p Transparent.json | 0 scripts/split.py | 42 - scripts/sync.py | 143 -- tests/regex.py | 152 -- 175 files changed, 16019 deletions(-) delete mode 100644 .github/workflows/add-issue-to-project.yml delete mode 100644 .github/workflows/new-branch-created.yml delete mode 100644 .github/workflows/sync.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 db/custom_formats/audio/ATMOS (Missing).json delete mode 100644 db/custom_formats/audio/ATMOS.json delete mode 100644 db/custom_formats/audio/DD+.json delete mode 100644 db/custom_formats/audio/DD.json delete mode 100644 db/custom_formats/audio/DTS-HD MA.json delete mode 100644 db/custom_formats/audio/DTS-X.json delete mode 100644 db/custom_formats/audio/DTS.json delete mode 100644 db/custom_formats/audio/FLAC.json delete mode 100644 db/custom_formats/audio/PCM.json delete mode 100644 db/custom_formats/audio/TrueHD (Missing).json delete mode 100644 db/custom_formats/audio/TrueHD.json delete mode 100644 db/custom_formats/codec/2160p x265.json delete mode 100644 db/custom_formats/codec/AV1.json delete mode 100644 db/custom_formats/codec/Blu-Ray (Remux).json delete mode 100644 db/custom_formats/codec/DVD REMUX .json delete mode 100644 db/custom_formats/codec/REMUX.json delete mode 100644 db/custom_formats/codec/VVC.json delete mode 100644 db/custom_formats/codec/WEBRip.json delete mode 100644 db/custom_formats/codec/Xvid.json delete mode 100644 db/custom_formats/codec/h265 (4k).json delete mode 100644 db/custom_formats/codec/h265.json delete mode 100644 db/custom_formats/codec/x264.json delete mode 100644 db/custom_formats/codec/x265 (Missing).json delete mode 100644 db/custom_formats/codec/x265 (Web).json delete mode 100644 db/custom_formats/codec/x265.json delete mode 100644 db/custom_formats/flag/Freeleech100.json delete mode 100644 db/custom_formats/flag/Freeleech25.json delete mode 100644 db/custom_formats/flag/Freeleech50.json delete mode 100644 db/custom_formats/flag/Freeleech75.json delete mode 100644 db/custom_formats/flag/Golden Popcorn 1080p.json delete mode 100644 db/custom_formats/flag/Golden Popcorn 720p.json delete mode 100644 db/custom_formats/flag/Golden Popcorn SD.json delete mode 100644 db/custom_formats/flag/HDBits Internal.json delete mode 100644 db/custom_formats/group/3L.json delete mode 100644 db/custom_formats/group/AnoZu.json delete mode 100644 db/custom_formats/group/BHDStudio (1080p x265).json delete mode 100644 db/custom_formats/group/BHDStudio.json delete mode 100644 db/custom_formats/group/BLURANiUM.json delete mode 100644 db/custom_formats/group/BMF.json delete mode 100644 db/custom_formats/group/BV.json delete mode 100644 db/custom_formats/group/BeyondHD.json delete mode 100644 db/custom_formats/group/CRX.json delete mode 100644 db/custom_formats/group/CRiSC.json delete mode 100644 db/custom_formats/group/Chivaman.json delete mode 100644 db/custom_formats/group/Chotab.json delete mode 100644 db/custom_formats/group/CtrlHD.json delete mode 100644 db/custom_formats/group/D-Z0N3.json delete mode 100644 db/custom_formats/group/DON.json delete mode 100644 db/custom_formats/group/Dariush .json delete mode 100644 db/custom_formats/group/Dariush SD.json delete mode 100644 db/custom_formats/group/E.N.D.json delete mode 100644 db/custom_formats/group/E1.json delete mode 100644 db/custom_formats/group/EA.json delete mode 100644 db/custom_formats/group/EDPH.json delete mode 100644 db/custom_formats/group/EPSiLON.json delete mode 100644 db/custom_formats/group/ESiR.json delete mode 100644 db/custom_formats/group/EXCiSiON.json delete mode 100644 db/custom_formats/group/EbP.json delete mode 100644 db/custom_formats/group/FTW-HD.json delete mode 100644 db/custom_formats/group/FoRM.json delete mode 100644 db/custom_formats/group/FraMeSToR.json delete mode 100644 db/custom_formats/group/GALAXY.json delete mode 100644 db/custom_formats/group/GRiMM.json delete mode 100644 db/custom_formats/group/GS88.json delete mode 100644 db/custom_formats/group/Geek.json delete mode 100644 db/custom_formats/group/GutS.json delete mode 100644 db/custom_formats/group/HANDJOB SD.json delete mode 100644 db/custom_formats/group/HANDJOB.json delete mode 100644 db/custom_formats/group/HDMaNiAcS.json delete mode 100644 db/custom_formats/group/HONE.json delete mode 100644 db/custom_formats/group/HiDt.json delete mode 100644 db/custom_formats/group/HiFi.json delete mode 100644 db/custom_formats/group/HiP.json delete mode 100644 db/custom_formats/group/IDE.json delete mode 100644 db/custom_formats/group/KASHMiR.json delete mode 100644 db/custom_formats/group/LEGi0N (x265).json delete mode 100644 db/custom_formats/group/LEGi0N.json delete mode 100644 db/custom_formats/group/LSt.json delete mode 100644 db/custom_formats/group/LoRD.json delete mode 100644 db/custom_formats/group/LolHD.json delete mode 100644 db/custom_formats/group/MTeam.json delete mode 100644 db/custom_formats/group/MainFrame.json delete mode 100644 db/custom_formats/group/NAN0.json delete mode 100644 db/custom_formats/group/NCmt.json delete mode 100644 db/custom_formats/group/NTb.json delete mode 100644 db/custom_formats/group/NyHD.json delete mode 100644 db/custom_formats/group/ORiGEN.json delete mode 100644 db/custom_formats/group/PTer.json delete mode 100644 db/custom_formats/group/Penumbra.json delete mode 100644 db/custom_formats/group/PmP.json delete mode 100644 db/custom_formats/group/Positive.json delete mode 100644 db/custom_formats/group/QxR.json delete mode 100644 db/custom_formats/group/R1GY3B B3YG1R.json delete mode 100644 db/custom_formats/group/Ralphy.json delete mode 100644 db/custom_formats/group/RightSIZE.json delete mode 100644 db/custom_formats/group/SA89.json delete mode 100644 db/custom_formats/group/SEV.json delete mode 100644 db/custom_formats/group/SaNcTi.json delete mode 100644 db/custom_formats/group/SbR.json delete mode 100644 db/custom_formats/group/Scene.json delete mode 100644 db/custom_formats/group/SiMPLE.json delete mode 100644 db/custom_formats/group/TAoE.json delete mode 100644 db/custom_formats/group/TBB SD.json delete mode 100644 db/custom_formats/group/TBB.json delete mode 100644 db/custom_formats/group/TDD.json delete mode 100644 db/custom_formats/group/TRiToN.json delete mode 100644 db/custom_formats/group/TayTo.json delete mode 100644 db/custom_formats/group/ThD.json delete mode 100644 db/custom_formats/group/TimeDistortion.json delete mode 100644 db/custom_formats/group/Unwanted x265 Groups.json delete mode 100644 db/custom_formats/group/VietHD.json delete mode 100644 db/custom_formats/group/Vyndros.json delete mode 100644 db/custom_formats/group/W4NK3R.json delete mode 100644 db/custom_formats/group/WMING.json delete mode 100644 db/custom_formats/group/WiLDCAT.json delete mode 100644 db/custom_formats/group/ZIMBO.json delete mode 100644 db/custom_formats/group/ZQ.json delete mode 100644 db/custom_formats/group/c0ke.json delete mode 100644 db/custom_formats/group/de[42].json delete mode 100644 db/custom_formats/group/decibeL.json delete mode 100644 db/custom_formats/group/dkore.json delete mode 100644 db/custom_formats/group/edge2020.json delete mode 100644 db/custom_formats/group/iFT.json delete mode 100644 db/custom_formats/group/jennaortegaUHD.json delete mode 100644 db/custom_formats/group/luvBB.json delete mode 100644 db/custom_formats/group/mHD.json delete mode 100644 db/custom_formats/group/nmd.json delete mode 100644 db/custom_formats/group/playBD.json delete mode 100644 db/custom_formats/group/playHD.json delete mode 100644 db/custom_formats/group/xander.json delete mode 100644 db/custom_formats/hdr/Dolby Vision wout Fallback.json delete mode 100644 db/custom_formats/hdr/Dolby Vision.json delete mode 100644 db/custom_formats/hdr/HDR10 (Missing) (x265 HDR only).json delete mode 100644 db/custom_formats/hdr/HDR10 (Missing).json delete mode 100644 db/custom_formats/hdr/HDR10+.json delete mode 100644 db/custom_formats/hdr/HDR10.json delete mode 100644 db/custom_formats/other/3D.json delete mode 100644 db/custom_formats/other/Black and White.json delete mode 100644 db/custom_formats/other/DVD.json delete mode 100644 db/custom_formats/other/Disc .json delete mode 100644 db/custom_formats/other/Extras.json delete mode 100644 db/custom_formats/other/IMAX.json delete mode 100644 db/custom_formats/other/LQ.json delete mode 100644 db/custom_formats/other/Stream Optimised.json delete mode 100644 db/custom_formats/other/UHDBits.json delete mode 100644 db/custom_formats/other/Upscaled.json delete mode 100644 db/custom_formats/resolution/1080p.json delete mode 100644 db/custom_formats/resolution/2160p.json delete mode 100644 db/custom_formats/resolution/480p.json delete mode 100644 db/custom_formats/resolution/720p.json delete mode 100644 db/custom_formats/resolution/Unwanted.json delete mode 100644 db/custom_formats/source/Blu-Ray.json delete mode 100644 db/custom_formats/source/UHD Bluray.json delete mode 100644 db/custom_formats/streaming/7PLUS.json delete mode 100644 db/custom_formats/streaming/Amazon Prime.json delete mode 100644 db/custom_formats/streaming/Apple TV+.json delete mode 100644 db/custom_formats/streaming/Disney+.json delete mode 100644 db/custom_formats/streaming/HBO Max.json delete mode 100644 db/custom_formats/streaming/Hulu.json delete mode 100644 db/custom_formats/streaming/MAX.json delete mode 100644 db/custom_formats/streaming/Movies Anywhere.json delete mode 100644 db/custom_formats/streaming/Netflix.json delete mode 100644 db/custom_formats/streaming/Paramount+.json delete mode 100644 db/custom_formats/streaming/Peacock TV.json delete mode 100644 db/custom_formats/streaming/ROKU.json delete mode 100644 db/custom_formats/streaming/iTunes (Missing).json delete mode 100644 db/custom_formats/streaming/iTunes.json delete mode 100644 db/quality_profiles/1080p Transparent.json delete mode 100644 scripts/split.py delete mode 100644 scripts/sync.py delete mode 100755 tests/regex.py diff --git a/.github/workflows/add-issue-to-project.yml b/.github/workflows/add-issue-to-project.yml deleted file mode 100644 index cbd2cdf..0000000 --- a/.github/workflows/add-issue-to-project.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: Add Issue to Project - -on: - issues: - types: [opened] - -jobs: - add-to-project: - name: Add issue to project - runs-on: ubuntu-latest - steps: - - name: Add to Project - id: add-to-project - uses: actions/add-to-project@v0.5.0 - with: - project-url: https://github.com/orgs/Dictionarry-Hub/projects/1 - github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} - - - name: Get project item ID - id: get-project-item-id - env: - GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} - PROJECT_ID: "PVT_kwDOCjbMFM4AjuUh" - ISSUE_NUMBER: ${{ github.event.issue.number }} - run: | - echo "Fetching project item ID for issue number: $ISSUE_NUMBER" - item_id=$(gh api graphql -f query=' - query($project:ID!) { - node(id: $project) { - ... on ProjectV2 { - items(first: 100) { - nodes { - id - content { - ... on Issue { - number - } - } - } - } - } - } - }' -f project=$PROJECT_ID --jq ".data.node.items.nodes[] | select(.content.number == $ISSUE_NUMBER) | .id" -F number=$ISSUE_NUMBER) - if [ -z "$item_id" ]; then - echo "Error: Project item ID not found for issue number $ISSUE_NUMBER" - exit 1 - else - echo "Project item ID found: $item_id" - echo "PROJECT_ITEM_ID=$item_id" >> $GITHUB_OUTPUT - fi - - - name: Set component, type, and status - env: - GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} - PROJECT_ITEM_ID: ${{ steps.get-project-item-id.outputs.PROJECT_ITEM_ID }} - run: | - echo "Setting fields for Project Item ID: ${PROJECT_ITEM_ID}" - - # Set component to "Database" - result=$(gh api graphql -f query=' - mutation($project:ID!, $item:ID!, $fieldId:ID!, $value:String!) { - updateProjectV2ItemFieldValue(input: { - projectId: $project - itemId: $item - fieldId: $fieldId - value: { - singleSelectOptionId: $value - } - }) { - projectV2Item { - id - } - } - }' -f project="PVT_kwDOCjbMFM4AjuUh" -f item="${PROJECT_ITEM_ID}" -f fieldId="PVTSSF_lADOCjbMFM4AjuUhzgcCr_E" -f value="64e29a2c") - echo "Set component result: $result" - - # Set status to "Backlog" - result=$(gh api graphql -f query=' - mutation($project:ID!, $item:ID!, $fieldId:ID!, $value:String!) { - updateProjectV2ItemFieldValue(input: { - projectId: $project - itemId: $item - fieldId: $fieldId - value: { - singleSelectOptionId: $value - } - }) { - projectV2Item { - id - } - } - }' -f project="PVT_kwDOCjbMFM4AjuUh" -f item="${PROJECT_ITEM_ID}" -f fieldId="PVTSSF_lADOCjbMFM4AjuUhzgcCn8s" -f value="f75ad846") - echo "Set status result: $result" - - # Get the label of the issue - LABEL=$(gh api repos/Dictionarry-Hub/database/issues/${{ github.event.issue.number }} --jq '.labels[0].name') - echo "Issue label: $LABEL" - - # Convert label to lowercase for comparison - LABEL_LOWER=$(echo "$LABEL" | tr '[:upper:]' '[:lower:]') - - # Set issue type based on label - ISSUE_TYPE_ID=$(case $LABEL_LOWER in - "bug") echo "b760225f" ;; - "improvement") echo "269885d0" ;; - *) echo "" ;; - esac) - - if [ -z "$ISSUE_TYPE_ID" ]; then - echo "No matching issue type for label: $LABEL" - else - echo "Setting issue type to ID: $ISSUE_TYPE_ID" - result=$(gh api graphql -f query=' - mutation($project:ID!, $item:ID!, $fieldId:ID!, $value:String!) { - updateProjectV2ItemFieldValue(input: { - projectId: $project - itemId: $item - fieldId: $fieldId - value: { - singleSelectOptionId: $value - } - }) { - projectV2Item { - id - } - } - }' -f project="PVT_kwDOCjbMFM4AjuUh" -f item="${PROJECT_ITEM_ID}" -f fieldId="PVTSSF_lADOCjbMFM4AjuUhzgcCswQ" -f value="$ISSUE_TYPE_ID") - echo "Set issue type result: $result" - fi \ No newline at end of file diff --git a/.github/workflows/new-branch-created.yml b/.github/workflows/new-branch-created.yml deleted file mode 100644 index 8e5a2a0..0000000 --- a/.github/workflows/new-branch-created.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: Update Issue Status to In Development - -on: - create: - branches: - - '*-*' - -jobs: - update-status: - runs-on: ubuntu-latest - steps: - - name: Extract Issue Number from Branch Name - id: extract-issue-number - run: | - ISSUE_NUMBER=$(echo $GITHUB_REF_NAME | cut -d'-' -f1) - echo "Issue Number extracted: $ISSUE_NUMBER" - echo "ISSUE_NUMBER=$ISSUE_NUMBER" >> $GITHUB_ENV - - - name: Get project item ID - id: get-project-item-id - env: - GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} - PROJECT_ID: "PVT_kwDOCjbMFM4AjuUh" - run: | - echo "Fetching project item ID for issue number: $ISSUE_NUMBER" - QUERY=' - query fetchProjectItem($project: ID!) { - node(id: $project) { - ... on ProjectV2 { - items(first: 100) { - nodes { - id - content { - ... on Issue { - number - } - } - } - } - } - } - }' - item_id=$(gh api graphql -f query="$QUERY" -f project=$PROJECT_ID --jq '.data.node.items.nodes[] | select(.content.number == '"$ISSUE_NUMBER"') | .id') - if [ -z "$item_id" ]; then - echo "Error: Project item ID not found for issue number $ISSUE_NUMBER" - exit 1 - else - echo "Project item ID found: $item_id" - echo "PROJECT_ITEM_ID=$item_id" >> $GITHUB_ENV - fi - - - name: Get single select field ID and options - id: get-field-options - env: - GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} - PROJECT_ID: "PVT_kwDOCjbMFM4AjuUh" - run: | - echo "Fetching field ID and options for status" - QUERY=' - query($project:ID!) { - node(id: $project) { - ... on ProjectV2 { - fields(first: 100) { - nodes { - ... on ProjectV2SingleSelectField { - id - name - options { - id - name - } - } - } - } - } - } - }' - field_data=$(gh api graphql -f query="$QUERY" -f project=$PROJECT_ID --jq '.data.node.fields.nodes[] | select(.name == "Status")') - field_id=$(echo $field_data | jq -r '.id') - in_development_option_id=$(echo $field_data | jq -r '.options[] | select(.name == "In Development") | .id') - if [ -z "$field_id" ] || [ -z "$in_development_option_id" ]; then - echo "Error: Field ID or In Development option ID not found" - exit 1 - else - echo "Field ID: $field_id" - echo "In Development option ID: $in_development_option_id" - echo "FIELD_ID=$field_id" >> $GITHUB_ENV - echo "IN_DEVELOPMENT_OPTION_ID=$in_development_option_id" >> $GITHUB_ENV - fi - - - name: Set status to In Development - env: - GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} - PROJECT_ITEM_ID: ${{ env.PROJECT_ITEM_ID }} - FIELD_ID: ${{ env.FIELD_ID }} - IN_DEVELOPMENT_OPTION_ID: ${{ env.IN_DEVELOPMENT_OPTION_ID }} - run: | - echo "Setting status for Project Item ID: ${PROJECT_ITEM_ID}" - result=$(gh api graphql -f query=' - mutation($project:ID!, $item:ID!, $fieldId:ID!, $value:String!) { - updateProjectV2ItemFieldValue(input: { - projectId: $project - itemId: $item - fieldId: $fieldId - value: { - singleSelectOptionId: $value - } - }) { - projectV2Item { - id - } - } - }' -f project="PVT_kwDOCjbMFM4AjuUh" -f item="${PROJECT_ITEM_ID}" -f fieldId="${FIELD_ID}" -f value="${IN_DEVELOPMENT_OPTION_ID}") - echo "Set status result: $result" diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml deleted file mode 100644 index b766946..0000000 --- a/.github/workflows/sync.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Sync to MongoDB - -on: - push: - branches: - - prod - -jobs: - sync: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pymongo[srv] - pip install colorama - - - name: Run sync script - env: - MONGODB_URI: ${{ secrets.MONGODB_URI }} - run: python scripts/sync.py \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 63cbe00..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Run Tests - -on: - push: - branches: [dev] - pull_request: - branches: [dev] - -jobs: - run-tests: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: Install dependencies - run: | - python3 -m pip install --upgrade pip - pip install colorama - - - name: Run regex tests - run: python3 tests/regex.py \ No newline at end of file diff --git a/db/custom_formats/audio/ATMOS (Missing).json b/db/custom_formats/audio/ATMOS (Missing).json deleted file mode 100644 index 5af24d0..0000000 --- a/db/custom_formats/audio/ATMOS (Missing).json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "ATMOS (Missing)", - "includeCustomFormatWhenRenaming": false, - "specifications": [ - { - "name": "TrueHD", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": false, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "True[ .-]?HD[ .-]?7\\.1", - "type": "textbox", - "advanced": false, - "privacy": "normal", - "isFloat": false - } - ] - }, - { - "name": "Atmos", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": true, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "\\bATMOS(\\b|\\d)", - "type": "textbox", - "advanced": false, - "privacy": "normal", - "isFloat": false - } - ] - }, - { - "name": "7.1", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": false, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "7.1", - "type": "textbox", - "advanced": false, - "privacy": "normal", - "isFloat": false - } - ] - } - ] -} diff --git a/db/custom_formats/audio/ATMOS.json b/db/custom_formats/audio/ATMOS.json deleted file mode 100644 index 2ecb3e3..0000000 --- a/db/custom_formats/audio/ATMOS.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "ATMOS", - "includeCustomFormatWhenRenaming": true, - "specifications": [ - { - "name": "ATMOS", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": false, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "\\bATMOS(\\b|\\d)", - "type": "textbox", - "advanced": false, - "privacy": "normal", - "isFloat": false - } - ] - } - ] -} diff --git a/db/custom_formats/audio/DD+.json b/db/custom_formats/audio/DD+.json deleted file mode 100644 index dabcc2d..0000000 --- a/db/custom_formats/audio/DD+.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "name": "DD+", - "includeCustomFormatWhenRenaming": false, - "specifications": [ - { - "name": "Dolby Digital Plus", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": false, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "\\bDD[P+](?!A)|\\b(e[-_. ]?ac3)\\b", - "type": "textbox", - "advanced": false, - "privacy": "normal", - "isFloat": false - } - ] - }, - { - "name": "TrueHD", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": true, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "True[ .-]?HD", - "type": "textbox", - "advanced": false, - "privacy": "normal", - "isFloat": false - } - ] - }, - { - "name": "Not DTS", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": true, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "\\bDTS(\\b|\\d)", - "type": "textbox", - "advanced": false, - "privacy": "normal", - "isFloat": false - } - ] - }, - { - "name": "Not FLAC", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": true, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "\\bFLAC(\\b|\\d)", - "type": "textbox", - "advanced": false, - "privacy": "normal", - "isFloat": false - } - ] - }, - { - "name": "Not AAC", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": true, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "\\bAAC(\\b|\\d)", - "type": "textbox", - "advanced": false, - "privacy": "normal", - "isFloat": false - } - ] - }, - { - "name": "Not PCM", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": true, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "\\b(l?)PCM(\\b|\\d)", - "type": "textbox", - "advanced": false, - "privacy": "normal", - "isFloat": false - } - ] - } - ] -} diff --git a/db/custom_formats/audio/DD.json b/db/custom_formats/audio/DD.json deleted file mode 100644 index 768751b..0000000 --- a/db/custom_formats/audio/DD.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "name": "DD", - "includeCustomFormatWhenRenaming": true, - "specifications": [ - { - "name": "Basic Dolby Digital", - "implementation": "ReleaseTitleSpecification", - "implementationName": "Release Title", - "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", - "negate": false, - "required": true, - "fields": [ - { - "order": 0, - "name": "value", - "label": "Regular Expression", - "helpText": "Custom Format RegEx is Case Insensitive", - "value": "\\bDD[^a-z+]|(? ") - sys.exit(1) - - input_file = sys.argv[1] - output_dir = sys.argv[2] - - if not os.path.isfile(input_file): - print(f"Input file not found: {input_file}") - sys.exit(1) - - process_json(input_file, output_dir) - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/scripts/sync.py b/scripts/sync.py deleted file mode 100644 index fd358d3..0000000 --- a/scripts/sync.py +++ /dev/null @@ -1,143 +0,0 @@ -import os -import json -from pymongo import MongoClient -from pymongo.server_api import ServerApi -from colorama import Fore, Style, init - -init(autoreset=True) # Initialize colorama - -def sync_custom_formats(db): - print(f"{Fore.CYAN}=== Starting Custom Formats Sync ==={Style.RESET_ALL}") - collection = db.custom_formats - base_path = 'db/custom_formats' - - total_formats = 0 - updated_formats = 0 - inserted_formats = 0 - skipped_formats = 0 - - for category in os.listdir(base_path): - category_path = os.path.join(base_path, category) - if os.path.isdir(category_path): - print(f"\n{Fore.YELLOW}Processing category: {category}{Style.RESET_ALL}") - for filename in os.listdir(category_path): - if filename.endswith('.json'): - file_path = os.path.join(category_path, filename) - try: - with open(file_path, 'r') as f: - content = f.read() - if not content.strip(): - print(f" {Fore.RED}! Skipped{Style.RESET_ALL} {filename} (Empty file)") - skipped_formats += 1 - continue - data = json.loads(content) - - name = data.get('name', os.path.splitext(filename)[0]) - - existing_doc = collection.find_one({'name': name}) - - if existing_doc: - result = collection.update_one( - {'name': name}, - {'$set': {'category': category, **data}} - ) - if result.modified_count > 0: - updated_formats += 1 - print(f" {Fore.GREEN}✓ Updated{Style.RESET_ALL} {name}") - else: - print(f" {Fore.YELLOW}○ No changes{Style.RESET_ALL} {name}") - else: - result = collection.insert_one({'category': category, **data}) - inserted_formats += 1 - print(f" {Fore.BLUE}+ Inserted{Style.RESET_ALL} {name}") - - total_formats += 1 - except json.JSONDecodeError: - print(f" {Fore.RED}! Skipped{Style.RESET_ALL} {filename} (Invalid JSON)") - skipped_formats += 1 - - print(f"\n{Fore.CYAN}=== Custom Formats Sync Summary ==={Style.RESET_ALL}") - print(f"Total formats processed: {total_formats}") - print(f"Updated: {Fore.GREEN}{updated_formats}{Style.RESET_ALL}") - print(f"Inserted: {Fore.BLUE}{inserted_formats}{Style.RESET_ALL}") - print(f"Unchanged: {Fore.YELLOW}{total_formats - updated_formats - inserted_formats}{Style.RESET_ALL}") - print(f"Skipped: {Fore.RED}{skipped_formats}{Style.RESET_ALL}") - -def sync_quality_profiles(db): - print(f"\n{Fore.CYAN}=== Starting Quality Profiles Sync ==={Style.RESET_ALL}") - collection = db.quality_profiles - base_path = 'db/quality_profiles' - - total_profiles = 0 - updated_profiles = 0 - inserted_profiles = 0 - skipped_profiles = 0 - - for filename in os.listdir(base_path): - if filename.endswith('.json'): - file_path = os.path.join(base_path, filename) - try: - with open(file_path, 'r') as f: - content = f.read() - if not content.strip(): - print(f"{Fore.RED}! Skipped{Style.RESET_ALL} {filename} (Empty file)") - skipped_profiles += 1 - continue - data = json.loads(content) - - # Handle the case where data is a list - if isinstance(data, list): - profiles = data - else: - profiles = [data] # Wrap single profile in a list - - for profile in profiles: - name = profile.get('name', os.path.splitext(filename)[0]) - - result = collection.replace_one( - {'name': name}, - profile, - upsert=True - ) - - total_profiles += 1 - if result.modified_count > 0: - updated_profiles += 1 - print(f"{Fore.GREEN}✓ Updated{Style.RESET_ALL} {name}") - elif result.upserted_id: - inserted_profiles += 1 - print(f"{Fore.BLUE}+ Inserted{Style.RESET_ALL} {name}") - else: - print(f"{Fore.YELLOW}○ No changes{Style.RESET_ALL} {name}") - - except json.JSONDecodeError: - print(f"{Fore.RED}! Skipped{Style.RESET_ALL} {filename} (Invalid JSON)") - skipped_profiles += 1 - - print(f"\n{Fore.CYAN}=== Quality Profiles Sync Summary ==={Style.RESET_ALL}") - print(f"Total profiles processed: {total_profiles}") - print(f"Updated: {Fore.GREEN}{updated_profiles}{Style.RESET_ALL}") - print(f"Inserted: {Fore.BLUE}{inserted_profiles}{Style.RESET_ALL}") - print(f"Unchanged: {Fore.YELLOW}{total_profiles - updated_profiles - inserted_profiles}{Style.RESET_ALL}") - print(f"Skipped: {Fore.RED}{skipped_profiles}{Style.RESET_ALL}") - -def main(): - print(f"{Fore.CYAN}Starting sync process...{Style.RESET_ALL}") - uri = os.environ.get('MONGODB_URI') - if not uri: - raise ValueError("MONGODB_URI environment variable is not set") - - client = MongoClient(uri, server_api=ServerApi('1')) - db = client.dictionarry - - try: - sync_custom_formats(db) - sync_quality_profiles(db) - print(f"\n{Fore.GREEN}Sync completed successfully.{Style.RESET_ALL}") - except Exception as e: - print(f"\n{Fore.RED}An error occurred: {e}{Style.RESET_ALL}") - finally: - client.close() - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/tests/regex.py b/tests/regex.py deleted file mode 100755 index f8244d7..0000000 --- a/tests/regex.py +++ /dev/null @@ -1,152 +0,0 @@ -import json -import subprocess -import time -import re -import os -import sys -from colorama import Fore, Style - -class RegexTester: - def __init__(self, max_retries=3, retry_delay=1): - self.max_retries = max_retries - self.retry_delay = retry_delay - - def get_latest_revision(self, unique_id): - url = f"https://regex101.com/api/regex/{unique_id}" - retries = 0 - while retries < self.max_retries: - try: - response = subprocess.check_output(["curl", "-s", url]) - data = json.loads(response.decode("utf-8")) - revisions = data["versions"] - latest_revision = revisions[-1] - return latest_revision - except (subprocess.CalledProcessError, json.JSONDecodeError) as e: - print(f"{Fore.YELLOW}Warning: {str(e)}. Retrying in {self.retry_delay} second(s)...{Style.RESET_ALL}") - retries += 1 - time.sleep(self.retry_delay) - raise Exception("Failed to retrieve latest revision after multiple retries.") - - def get_regex_data(self, unique_id, revision): - url = f"https://regex101.com/api/regex/{unique_id}/{revision}" - retries = 0 - while retries < self.max_retries: - try: - response = subprocess.check_output(["curl", "-s", url]) - data = json.loads(response.decode("utf-8")) - regex_pattern = data["regex"] - unit_tests = data["unitTests"] - flavor = data["flavor"] - return regex_pattern, unit_tests, flavor - except (subprocess.CalledProcessError, json.JSONDecodeError) as e: - print(f"{Fore.YELLOW}Warning: {str(e)}. Retrying in {self.retry_delay} second(s)...{Style.RESET_ALL}") - retries += 1 - time.sleep(self.retry_delay) - raise Exception("Failed to retrieve regex data after multiple retries.") - - def run_unit_tests(self, regex_pattern, flavor, unit_tests): - success_count = 0 - failure_count = 0 - if flavor == "pcre2": - regex_flags = re.MULTILINE | re.IGNORECASE | re.DOTALL - else: - regex_flags = re.MULTILINE | re.IGNORECASE - - for test in unit_tests: - test_string = test["testString"] - criteria = test["criteria"] - target = test["target"] - - if target == "REGEX": - matches = re.finditer(regex_pattern, test_string, regex_flags) - match_found = bool(list(matches)) - - if criteria == "DOES_MATCH": - if match_found: - success_count += 1 - print(f"{Fore.GREEN}Passed test{Style.RESET_ALL}: '{test_string}'") - else: - failure_count += 1 - print(f"{Fore.RED}Should match{Style.RESET_ALL} '{test_string}'") - elif criteria == "DOES_NOT_MATCH": - if not match_found: - success_count += 1 - print(f"{Fore.GREEN}Passed test{Style.RESET_ALL}: '{test_string}'") - else: - failure_count += 1 - print(f"{Fore.RED}Shouldn't match{Style.RESET_ALL} '{test_string}'") - - return success_count, failure_count - -def extract_regex_ids(data): - regex_ids = {} - - def extract_ids(obj): - if isinstance(obj, dict): - if "fields" in obj: - for field in obj["fields"]: - if "regexID" in field: - regex_id = field["regexID"] - name = obj.get("name", "") - regex_ids[regex_id] = name - for value in obj.values(): - extract_ids(value) - elif isinstance(obj, list): - for item in obj: - extract_ids(item) - - extract_ids(data) - return regex_ids - -def main(): - tester = RegexTester() - regex_dir = "./db/custom_formats" - tested_ids = set() - any_test_failed = False - - for root, dirs, files in os.walk(regex_dir): - for filename in files: - if filename.endswith(".json"): - filepath = os.path.join(root, filename) - with open(filepath, "r") as f: - data = json.load(f) - - regex_ids = extract_regex_ids(data) - - for regex_id, name in regex_ids.items(): - if regex_id not in tested_ids: - tested_ids.add(regex_id) - try: - latest_revision = tester.get_latest_revision(regex_id) - regex_pattern, unit_tests, flavor = tester.get_regex_data(regex_id, latest_revision) - print(f"====================") - print(f"Running Test: {Fore.YELLOW}{name}{Style.RESET_ALL}") - print(f"Regex: {Fore.YELLOW}{regex_pattern}{Style.RESET_ALL}") - print(f"Link: {Fore.BLUE}https://regex101.com/r/{regex_id}{Style.RESET_ALL}") - print(f"====================") - print() - - total_tests = len(unit_tests) - passed_tests, failed_tests = tester.run_unit_tests(regex_pattern, flavor, unit_tests) - - score_color = Fore.GREEN if passed_tests == total_tests else Fore.RED - status_text = "PASS" if failed_tests == 0 else "FAIL" - status_color = Fore.GREEN if status_text == "PASS" else Fore.RED - - print() - print(f"====================") - print(f"Score: {score_color}{passed_tests} / {total_tests}{Style.RESET_ALL}") - print(f"Status: {status_color}{status_text}{Style.RESET_ALL}") - print(f"====================") - print() - - if failed_tests > 0: - sys.exit(1) - except Exception as e: - print(f"{Fore.RED}Error processing regex {regex_id}: {str(e)}{Style.RESET_ALL}") - print() - sys.exit(1) - sys.exit(0) - -if __name__ == "__main__": - main() \ No newline at end of file