mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
integrations: Add Sonarr Integration.
This commit is contained in:
BIN
static/images/integrations/bot_avatars/sonarr.png
Normal file
BIN
static/images/integrations/bot_avatars/sonarr.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
1
static/images/integrations/logos/sonarr.svg
Normal file
1
static/images/integrations/logos/sonarr.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg height="216.9" width="216.7" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M216.7 108.45c0 29.833-10.533 55.4-31.6 76.7-.7.833-1.483 1.6-2.35 2.3a92.767 92.767 0 0 1-11 9.25c-18.267 13.467-39.367 20.2-63.3 20.2-23.967 0-45.033-6.733-63.2-20.2-4.8-3.4-9.3-7.25-13.5-11.55-16.367-16.266-26.417-35.167-30.15-56.7-.733-4.2-1.217-8.467-1.45-12.8-.1-2.4-.15-4.8-.15-7.2 0-2.533.05-4.95.15-7.25 0-.233.066-.467.2-.7 1.567-26.6 12.033-49.583 31.4-68.95C53.05 10.517 78.617 0 108.45 0c29.933 0 55.484 10.517 76.65 31.55 21.067 21.433 31.6 47.067 31.6 76.9z" fill="#EEE" fill-rule="evenodd"/><path clip-rule="evenodd" d="m194.65 42.5-22.4 22.4C159.152 77.998 158 89.4 158 109.5c0 17.934 2.852 34.352 16.2 47.7 9.746 9.746 19 18.95 19 18.95-2.5 3.067-5.2 6.067-8.1 9-.7.833-1.483 1.6-2.35 2.3a90.601 90.601 0 0 1-7.9 6.95l-17.55-17.55c-15.598-15.6-27.996-17.1-48.6-17.1-19.77 0-33.223 1.822-47.7 16.3-8.647 8.647-18.55 18.6-18.55 18.6a95.782 95.782 0 0 1-10.7-9.5c-2.8-2.8-5.417-5.667-7.85-8.6 0 0 9.798-9.848 19.15-19.2 13.852-13.853 16.1-29.916 16.1-47.85 0-17.5-2.874-33.823-15.6-46.55-8.835-8.836-21.05-21-21.05-21 2.833-3.6 5.917-7.067 9.25-10.4a134.482 134.482 0 0 1 9-8.05L61.1 43.85C74.102 56.852 90.767 60.2 108.7 60.2c18.467 0 35.077-3.577 48.6-17.1 8.32-8.32 19.3-19.25 19.3-19.25 2.9 2.367 5.733 4.933 8.5 7.7a121.188 121.188 0 0 1 9.55 10.95z" fill="#3A3F51" fill-rule="evenodd"/><g clip-rule="evenodd"><path d="M78.7 114c-.2-1.167-.332-2.35-.4-3.55a39.613 39.613 0 0 1 0-4c0-.067.018-.133.05-.2.435-7.367 3.334-13.733 8.7-19.1 5.9-5.833 12.984-8.75 21.25-8.75 8.3 0 15.384 2.917 21.25 8.75 5.834 5.934 8.75 13.033 8.75 21.3 0 8.267-2.916 15.35-8.75 21.25-.2.233-.416.45-.65.65a27.364 27.364 0 0 1-3.05 2.55c-5.065 3.733-10.916 5.6-17.55 5.6s-12.466-1.866-17.5-5.6a26.29 26.29 0 0 1-3.75-3.2c-4.532-4.5-7.316-9.734-8.35-15.7z" fill="#0CF" fill-rule="evenodd"/><path d="m157.8 59.75-15 14.65M30.785 32.526 71.65 73.25m84.6 84.25 27.808 28.78m1.855-153.894L157.8 59.75m-125.45 126 27.35-27.4" fill="none" stroke="#0CF" stroke-miterlimit="1" stroke-width="2"/><path d="m157.8 59.75-16.95 17.2M58.97 60.604l17.2 17.15M59.623 158.43l16.75-17.4m61.928-1.396 18.028 17.945" fill="none" stroke="#0CF" stroke-miterlimit="1" stroke-width="7"/></g></svg>
|
After Width: | Height: | Size: 2.2 KiB |
BIN
static/images/integrations/sonarr/001.png
Normal file
BIN
static/images/integrations/sonarr/001.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
@@ -438,6 +438,7 @@ WEBHOOK_INTEGRATIONS: List[WebhookIntegration] = [
|
||||
),
|
||||
WebhookIntegration("slack", ["communication"]),
|
||||
WebhookIntegration("solano", ["continuous-integration"], display_name="Solano Labs"),
|
||||
WebhookIntegration("sonarr", ["entertainment"], display_name="Sonarr"),
|
||||
WebhookIntegration("splunk", ["monitoring"], display_name="Splunk"),
|
||||
WebhookIntegration("statuspage", ["customer-support"], display_name="Statuspage"),
|
||||
WebhookIntegration("stripe", ["financial"], display_name="Stripe"),
|
||||
@@ -771,6 +772,7 @@ DOC_SCREENSHOT_CONFIG: Dict[str, List[BaseScreenshotConfig]] = {
|
||||
],
|
||||
"slack": [ScreenshotConfig("message_info.txt")],
|
||||
"solano": [ScreenshotConfig("build_001.json")],
|
||||
"sonarr": [ScreenshotConfig("sonarr_episode_grabbed.json")],
|
||||
"splunk": [ScreenshotConfig("search_one_result.json")],
|
||||
"statuspage": [ScreenshotConfig("incident_created.json")],
|
||||
"stripe": [ScreenshotConfig("charge_succeeded__card.json")],
|
||||
|
0
zerver/webhooks/sonarr/__init__.py
Normal file
0
zerver/webhooks/sonarr/__init__.py
Normal file
22
zerver/webhooks/sonarr/doc.md
Normal file
22
zerver/webhooks/sonarr/doc.md
Normal file
@@ -0,0 +1,22 @@
|
||||
Receive Sonarr notifications in Zulip!
|
||||
|
||||
1. {!create-stream.md!}
|
||||
|
||||
1. {!create-bot-construct-url-indented.md!}
|
||||
|
||||
1. Go to your Sonarr dashboard. Click **Settings** and click **Connect**.
|
||||
Click the **+** icon.
|
||||
|
||||
1. Select **Webhook** and set the name of the webhook to any name of your
|
||||
choice (e.g **Zulip**). Select the scenarios you would like to receive
|
||||
notifications for. You may also enter tags if you would like to be
|
||||
notified about series with specific tags.
|
||||
|
||||
1. Set **URL** to the **URL** constructed above. Set **Method** to **POST**
|
||||
and leave the **Username** and **Password** fields blank.
|
||||
|
||||
1. Click **Save** and you should receive a test message.
|
||||
|
||||
{!congrats.md!}
|
||||
|
||||

|
760
zerver/webhooks/sonarr/fixtures/sonarr_episode_deleted.json
Normal file
760
zerver/webhooks/sonarr/fixtures/sonarr_episode_deleted.json
Normal file
@@ -0,0 +1,760 @@
|
||||
{
|
||||
"series": {
|
||||
"id": 92,
|
||||
"title": "Breaking Bad",
|
||||
"path": "/home36/adbtech/media/TV Shows/Breaking Bad",
|
||||
"tvdbId": 81189,
|
||||
"tvMazeId": 169,
|
||||
"imdbId": "tt0903747",
|
||||
"type": "standard"
|
||||
},
|
||||
"episodes": [
|
||||
{
|
||||
"id": 8894,
|
||||
"episodeNumber": 1,
|
||||
"seasonNumber": 1,
|
||||
"title": "Pilot",
|
||||
"airDate": "2008-01-20",
|
||||
"airDateUtc": "2008-01-21T02:00:00Z"
|
||||
}
|
||||
],
|
||||
"episodeFile": {
|
||||
"seriesId": 92,
|
||||
"seasonNumber": 1,
|
||||
"relativePath": "Breaking Bad - 1x01 - Pilot.mkv",
|
||||
"path": "/home36/adbtech/media/TV Shows/Breaking Bad/Breaking Bad - 1x01 - Pilot.mkv",
|
||||
"size": 1172453261,
|
||||
"dateAdded": "2021-03-26T02:30:13.445127Z",
|
||||
"quality": {
|
||||
"quality": {
|
||||
"id": 9,
|
||||
"name": "HDTV-1080p",
|
||||
"source": "television",
|
||||
"resolution": 1080
|
||||
},
|
||||
"revision": {
|
||||
"version": 1,
|
||||
"real": 0,
|
||||
"isRepack": false
|
||||
}
|
||||
},
|
||||
"mediaInfo": {
|
||||
"containerFormat": "Matroska",
|
||||
"videoFormat": "HEVC",
|
||||
"videoCodecID": "V_MPEGH/ISO/HEVC",
|
||||
"videoProfile": "Main@L4@Main",
|
||||
"videoCodecLibrary": "x265 - 1.9:[Windows][GCC 4.9.0][64 bit] 8bit",
|
||||
"videoBitrate": 2252712,
|
||||
"videoBitDepth": 8,
|
||||
"videoMultiViewCount": 0,
|
||||
"videoColourPrimaries": "BT.709",
|
||||
"videoTransferCharacteristics": "BT.709",
|
||||
"videoHdrFormat": "",
|
||||
"videoHdrFormatCompatibility": "",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"audioFormat": "AC-3",
|
||||
"audioCodecID": "A_AC3",
|
||||
"audioCodecLibrary": "",
|
||||
"audioAdditionalFeatures": "",
|
||||
"audioBitrate": 384000,
|
||||
"runTime": "00:58:06.5280000",
|
||||
"audioStreamCount": 1,
|
||||
"audioChannelsContainer": 6,
|
||||
"audioChannelsStream": 0,
|
||||
"audioChannelPositions": "3/2/0.1",
|
||||
"audioChannelPositionsTextContainer": "Front: L C R, Side: L R, LFE",
|
||||
"audioChannelPositionsTextStream": "",
|
||||
"audioProfile": "",
|
||||
"videoFps": 23.976,
|
||||
"audioLanguages": "English",
|
||||
"subtitles": "English / English / Arabic / Dutch / French / French / German / German / Hindi / Spanish / Spanish / Turkish / English / Dutch / French / German / Spanish",
|
||||
"scanType": "",
|
||||
"schemaRevision": 7
|
||||
},
|
||||
"episodes": {
|
||||
"value": [
|
||||
{
|
||||
"seriesId": 92,
|
||||
"episodeFileId": 4843,
|
||||
"seasonNumber": 1,
|
||||
"episodeNumber": 1,
|
||||
"title": "Pilot",
|
||||
"airDate": "2008-01-20",
|
||||
"airDateUtc": "2008-01-21T02:00:00Z",
|
||||
"overview": "When an unassuming high school chemistry teacher discovers he has a rare form of lung cancer, he decides to team up with a former student and create a top of the line crystal meth in a used RV, to provide for his family once he is gone.",
|
||||
"monitored": true,
|
||||
"absoluteEpisodeNumber": 1,
|
||||
"unverifiedSceneNumbering": false,
|
||||
"ratings": {
|
||||
"votes": 12684,
|
||||
"value": 7.7
|
||||
},
|
||||
"images": [
|
||||
{
|
||||
"coverType": "screenshot",
|
||||
"url": "https://artworks.thetvdb.com/banners/episodes/81189/349232.jpg"
|
||||
}
|
||||
],
|
||||
"episodeFile": {
|
||||
"isLoaded": true
|
||||
},
|
||||
"hasFile": true,
|
||||
"id": 8894
|
||||
}
|
||||
],
|
||||
"isLoaded": true
|
||||
},
|
||||
"series": {
|
||||
"value": {
|
||||
"tvdbId": 81189,
|
||||
"tvRageId": 18164,
|
||||
"tvMazeId": 169,
|
||||
"imdbId": "tt0903747",
|
||||
"title": "Breaking Bad",
|
||||
"cleanTitle": "breakingbad",
|
||||
"sortTitle": "breaking bad",
|
||||
"status": "ended",
|
||||
"overview": "When Walter White, a chemistry teacher, is diagnosed with Stage III cancer and given a prognosis of two years left to live, he chooses to enter a dangerous world of drugs and crime with the intent to secure his family's financial security.",
|
||||
"airTime": "21:00",
|
||||
"monitored": true,
|
||||
"qualityProfileId": 3,
|
||||
"languageProfileId": 1,
|
||||
"seasonFolder": true,
|
||||
"lastInfoSync": "2021-03-26T02:30:13.193374Z",
|
||||
"runtime": 47,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "banner",
|
||||
"url": "https://artworks.thetvdb.com/banners/graphical/81189-g21.jpg"
|
||||
},
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/posters/81189-10.jpg"
|
||||
},
|
||||
{
|
||||
"coverType": "fanart",
|
||||
"url": "https://artworks.thetvdb.com/banners/fanart/original/81189-21.jpg"
|
||||
}
|
||||
],
|
||||
"seriesType": "standard",
|
||||
"network": "Netflix",
|
||||
"useSceneNumbering": false,
|
||||
"titleSlug": "breaking-bad",
|
||||
"path": "/home36/adbtech/media/TV Shows/Breaking Bad",
|
||||
"year": 2008,
|
||||
"ratings": {
|
||||
"votes": 31714,
|
||||
"value": 9.4
|
||||
},
|
||||
"genres": [
|
||||
"Crime",
|
||||
"Drama",
|
||||
"Suspense",
|
||||
"Thriller"
|
||||
],
|
||||
"actors": [
|
||||
{
|
||||
"name": "Bryan Cranston",
|
||||
"character": "Walter White",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Anna Gunn",
|
||||
"character": "Skyler White",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Aaron Paul",
|
||||
"character": "Jesse Pinkman",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "RJ Mitte",
|
||||
"character": "Walter White Jr.",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Dean Norris",
|
||||
"character": "Hank Schrader",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Betsy Brandt",
|
||||
"character": "Marie Schrader",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Bob Odenkirk",
|
||||
"character": "Saul Goodman",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Giancarlo Esposito",
|
||||
"character": "Gustavo Fring",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Banks",
|
||||
"character": "Mike Ehrmantraut",
|
||||
"images": []
|
||||
}
|
||||
],
|
||||
"certification": "TV-MA",
|
||||
"added": "2021-03-26T02:29:30.73166Z",
|
||||
"firstAired": "2008-01-20T00:00:00Z",
|
||||
"qualityProfile": {
|
||||
"value": {
|
||||
"name": "HD-720p",
|
||||
"upgradeAllowed": false,
|
||||
"cutoff": 4,
|
||||
"items": [
|
||||
{
|
||||
"quality": {
|
||||
"id": 0,
|
||||
"name": "Unknown",
|
||||
"source": "unknown",
|
||||
"resolution": 0
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 1,
|
||||
"name": "SDTV",
|
||||
"source": "television",
|
||||
"resolution": 480
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"id": 1000,
|
||||
"name": "WEB 480p",
|
||||
"items": [
|
||||
{
|
||||
"quality": {
|
||||
"id": 12,
|
||||
"name": "WEBRip-480p",
|
||||
"source": "webRip",
|
||||
"resolution": 480
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 8,
|
||||
"name": "WEBDL-480p",
|
||||
"source": "web",
|
||||
"resolution": 480
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
}
|
||||
],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 2,
|
||||
"name": "DVD",
|
||||
"source": "dvd",
|
||||
"resolution": 480
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 13,
|
||||
"name": "Bluray-480p",
|
||||
"source": "bluray",
|
||||
"resolution": 480
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 4,
|
||||
"name": "HDTV-720p",
|
||||
"source": "television",
|
||||
"resolution": 720
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 9,
|
||||
"name": "HDTV-1080p",
|
||||
"source": "television",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 10,
|
||||
"name": "Raw-HD",
|
||||
"source": "televisionRaw",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"id": 1001,
|
||||
"name": "WEB 720p",
|
||||
"items": [
|
||||
{
|
||||
"quality": {
|
||||
"id": 14,
|
||||
"name": "WEBRip-720p",
|
||||
"source": "webRip",
|
||||
"resolution": 720
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 5,
|
||||
"name": "WEBDL-720p",
|
||||
"source": "web",
|
||||
"resolution": 720
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
}
|
||||
],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 6,
|
||||
"name": "Bluray-720p",
|
||||
"source": "bluray",
|
||||
"resolution": 720
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"id": 1002,
|
||||
"name": "WEB 1080p",
|
||||
"items": [
|
||||
{
|
||||
"quality": {
|
||||
"id": 15,
|
||||
"name": "WEBRip-1080p",
|
||||
"source": "webRip",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 3,
|
||||
"name": "WEBDL-1080p",
|
||||
"source": "web",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
}
|
||||
],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 7,
|
||||
"name": "Bluray-1080p",
|
||||
"source": "bluray",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 20,
|
||||
"name": "Bluray-1080p Remux",
|
||||
"source": "blurayRaw",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 16,
|
||||
"name": "HDTV-2160p",
|
||||
"source": "television",
|
||||
"resolution": 2160
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"id": 1003,
|
||||
"name": "WEB 2160p",
|
||||
"items": [
|
||||
{
|
||||
"quality": {
|
||||
"id": 17,
|
||||
"name": "WEBRip-2160p",
|
||||
"source": "webRip",
|
||||
"resolution": 2160
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 18,
|
||||
"name": "WEBDL-2160p",
|
||||
"source": "web",
|
||||
"resolution": 2160
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
}
|
||||
],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 19,
|
||||
"name": "Bluray-2160p",
|
||||
"source": "bluray",
|
||||
"resolution": 2160
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 21,
|
||||
"name": "Bluray-2160p Remux",
|
||||
"source": "blurayRaw",
|
||||
"resolution": 2160
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
}
|
||||
],
|
||||
"id": 3
|
||||
},
|
||||
"isLoaded": true
|
||||
},
|
||||
"languageProfile": {
|
||||
"value": {
|
||||
"name": "English",
|
||||
"languages": [
|
||||
{
|
||||
"language": {
|
||||
"id": 27,
|
||||
"name": "Hindi"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 26,
|
||||
"name": "Arabic"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 13,
|
||||
"name": "Vietnamese"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 0,
|
||||
"name": "Unknown"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 17,
|
||||
"name": "Turkish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 14,
|
||||
"name": "Swedish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 3,
|
||||
"name": "Spanish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 11,
|
||||
"name": "Russian"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 18,
|
||||
"name": "Portuguese"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 12,
|
||||
"name": "Polish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 15,
|
||||
"name": "Norwegian"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 24,
|
||||
"name": "Lithuanian"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 21,
|
||||
"name": "Korean"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 8,
|
||||
"name": "Japanese"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 5,
|
||||
"name": "Italian"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 9,
|
||||
"name": "Icelandic"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 22,
|
||||
"name": "Hungarian"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 23,
|
||||
"name": "Hebrew"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 20,
|
||||
"name": "Greek"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 4,
|
||||
"name": "German"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 2,
|
||||
"name": "French"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 19,
|
||||
"name": "Flemish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 16,
|
||||
"name": "Finnish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 1,
|
||||
"name": "English"
|
||||
},
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 7,
|
||||
"name": "Dutch"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 6,
|
||||
"name": "Danish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 25,
|
||||
"name": "Czech"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 10,
|
||||
"name": "Chinese"
|
||||
},
|
||||
"allowed": false
|
||||
}
|
||||
],
|
||||
"upgradeAllowed": false,
|
||||
"cutoff": {
|
||||
"id": 1,
|
||||
"name": "English"
|
||||
},
|
||||
"id": 1
|
||||
},
|
||||
"isLoaded": true
|
||||
},
|
||||
"seasons": [
|
||||
{
|
||||
"seasonNumber": 0,
|
||||
"monitored": false,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasons/81189-0.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"seasonNumber": 1,
|
||||
"monitored": true,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasons/81189-1-3.jpg"
|
||||
},
|
||||
{
|
||||
"coverType": "banner",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasonswide/81189-1.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"seasonNumber": 2,
|
||||
"monitored": true,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasons/81189-2-17.jpg"
|
||||
},
|
||||
{
|
||||
"coverType": "banner",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasonswide/81189-2.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"seasonNumber": 3,
|
||||
"monitored": true,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasons/81189-3-16.jpg"
|
||||
},
|
||||
{
|
||||
"coverType": "banner",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasonswide/81189-3.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"seasonNumber": 4,
|
||||
"monitored": true,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasons/81189-4-15.jpg"
|
||||
},
|
||||
{
|
||||
"coverType": "banner",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasonswide/81189-4.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"seasonNumber": 5,
|
||||
"monitored": true,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasons/81189-5-18.jpg"
|
||||
},
|
||||
{
|
||||
"coverType": "banner",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasonswide/81189-5.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"tags": [],
|
||||
"id": 92
|
||||
},
|
||||
"isLoaded": true
|
||||
},
|
||||
"language": {
|
||||
"id": 1,
|
||||
"name": "English"
|
||||
},
|
||||
"id": 4843
|
||||
},
|
||||
"deleteReason": "manual",
|
||||
"eventType": "EpisodeFileDelete"
|
||||
}
|
@@ -0,0 +1,720 @@
|
||||
{
|
||||
"series": {
|
||||
"id": 11,
|
||||
"title": "S.W.A.T. (2017)",
|
||||
"path": "/home36/adbtech/media/TV Shows/S.W.A.T. (2017)",
|
||||
"tvdbId": 328687,
|
||||
"tvMazeId": 21532,
|
||||
"imdbId": "tt6111130",
|
||||
"type": "standard"
|
||||
},
|
||||
"episodes": [
|
||||
{
|
||||
"id": 8198,
|
||||
"episodeNumber": 10,
|
||||
"seasonNumber": 4,
|
||||
"title": "Buried",
|
||||
"airDate": "2021-03-03",
|
||||
"airDateUtc": "2021-03-04T03:00:00Z"
|
||||
}
|
||||
],
|
||||
"episodeFile": {
|
||||
"seriesId": 11,
|
||||
"seasonNumber": 4,
|
||||
"relativePath": "Season 4/S.W.A.T. (2017) - S04E10 - Buried SDTV.mkv",
|
||||
"path": "/home36/adbtech/media/TV Shows/S.W.A.T. (2017)/Season 4/S.W.A.T. (2017) - S04E10 - Buried SDTV.mkv",
|
||||
"size": 401690753,
|
||||
"dateAdded": "2021-03-04T05:05:36.86463Z",
|
||||
"originalFilePath": "S.W.A.T.2017.S04E10.HDTV.x264-PHOENiX[eztv.re].mkv",
|
||||
"sceneName": "S.W.A.T.2017.S04E10.HDTV.x264-PHOENiX[eztv.re]",
|
||||
"releaseGroup": "PHOENiX",
|
||||
"quality": {
|
||||
"quality": {
|
||||
"id": 1,
|
||||
"name": "SDTV",
|
||||
"source": "television",
|
||||
"resolution": 480
|
||||
},
|
||||
"revision": {
|
||||
"version": 1,
|
||||
"real": 0,
|
||||
"isRepack": false
|
||||
}
|
||||
},
|
||||
"mediaInfo": {
|
||||
"containerFormat": "Matroska",
|
||||
"videoFormat": "AVC",
|
||||
"videoCodecID": "V_MPEG4/ISO/AVC",
|
||||
"videoProfile": "High@L3",
|
||||
"videoCodecLibrary": "x264 - core 157",
|
||||
"videoBitrate": 6572890,
|
||||
"videoBitDepth": 8,
|
||||
"videoMultiViewCount": 0,
|
||||
"videoColourPrimaries": "",
|
||||
"videoTransferCharacteristics": "",
|
||||
"width": 720,
|
||||
"height": 400,
|
||||
"audioFormat": "AAC",
|
||||
"audioCodecID": "A_AAC-2",
|
||||
"audioCodecLibrary": "Lavc58.35.100 aac",
|
||||
"audioAdditionalFeatures": "LC",
|
||||
"audioBitrate": 384000,
|
||||
"runTime": "00:42:14.1760000",
|
||||
"audioStreamCount": 1,
|
||||
"audioChannelsContainer": 2,
|
||||
"audioChannelsStream": 0,
|
||||
"audioChannelPositions": "2/0/0",
|
||||
"audioChannelPositionsTextContainer": "Front: L R",
|
||||
"audioProfile": "",
|
||||
"videoFps": 23.976,
|
||||
"audioLanguages": "English",
|
||||
"subtitles": "",
|
||||
"scanType": "Progressive",
|
||||
"schemaRevision": 5
|
||||
},
|
||||
"episodes": {
|
||||
"value": [
|
||||
{
|
||||
"seriesId": 11,
|
||||
"episodeFileId": 4644,
|
||||
"seasonNumber": 4,
|
||||
"episodeNumber": 10,
|
||||
"title": "Buried",
|
||||
"airDate": "2021-03-03",
|
||||
"airDateUtc": "2021-03-04T03:00:00Z",
|
||||
"overview": "As the SWAT team helps the LAPD search for the prime suspect in a woman’s disappearance, they’re joined in the field by a new team member. The personal strain between Chris and Street comes to a head as both await Hicks’ decision on who the winner is of a prestigious leadership competition.",
|
||||
"monitored": true,
|
||||
"absoluteEpisodeNumber": 76,
|
||||
"unverifiedSceneNumbering": false,
|
||||
"ratings": {
|
||||
"votes": 0,
|
||||
"value": 0.0
|
||||
},
|
||||
"images": [
|
||||
{
|
||||
"coverType": "screenshot",
|
||||
"url": "https://artworks.thetvdb.com/banners/series/328687/episodes/604212e57b8d2.jpg"
|
||||
}
|
||||
],
|
||||
"lastSearchTime": "2021-03-26T02:33:32.478455Z",
|
||||
"episodeFile": {
|
||||
"isLoaded": true
|
||||
},
|
||||
"hasFile": true,
|
||||
"id": 8198
|
||||
}
|
||||
],
|
||||
"isLoaded": true
|
||||
},
|
||||
"series": {
|
||||
"value": {
|
||||
"tvdbId": 328687,
|
||||
"tvRageId": 0,
|
||||
"tvMazeId": 21532,
|
||||
"imdbId": "tt6111130",
|
||||
"title": "S.W.A.T. (2017)",
|
||||
"cleanTitle": "swt2017",
|
||||
"sortTitle": "s w t 2017",
|
||||
"status": "continuing",
|
||||
"overview": "Los Angeles S.W.A.T. Lieutenant Daniel ‘Hondo’ Harrelson is assigned to lead a highly-skilled unit in the community where he grew up. Torn between loyalty to the streets where the cops are sometimes the enemy, and allegiance to his brothers in blue, he strategically straddles these two worlds. Hondo encourages his team to rely on communication and respect over force and aggression, but when a crisis erupts, these unflinching men and women are prepared to put their tactical training to the test.",
|
||||
"airTime": "22:00",
|
||||
"monitored": true,
|
||||
"qualityProfileId": 3,
|
||||
"languageProfileId": 1,
|
||||
"seasonFolder": true,
|
||||
"lastInfoSync": "2021-03-26T02:29:02.009181Z",
|
||||
"runtime": 45,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "banner",
|
||||
"url": "https://artworks.thetvdb.com/banners/graphical/328687-g.jpg"
|
||||
},
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/posters/328687-2.jpg"
|
||||
},
|
||||
{
|
||||
"coverType": "fanart",
|
||||
"url": "https://artworks.thetvdb.com/banners/fanart/original/5d4d461189894.jpg"
|
||||
}
|
||||
],
|
||||
"seriesType": "standard",
|
||||
"network": "CBS",
|
||||
"useSceneNumbering": false,
|
||||
"titleSlug": "s-w-a-t-2017",
|
||||
"path": "/home36/adbtech/media/TV Shows/S.W.A.T. (2017)",
|
||||
"year": 2017,
|
||||
"ratings": {
|
||||
"votes": 460,
|
||||
"value": 7.5
|
||||
},
|
||||
"genres": [
|
||||
"Action",
|
||||
"Crime",
|
||||
"Drama"
|
||||
],
|
||||
"actors": [
|
||||
{
|
||||
"name": "Shemar Moore",
|
||||
"character": "Daniel “Hondo” Harrelson",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Jay Harrington",
|
||||
"character": "David “Deacon” Kay",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Alex Russell",
|
||||
"character": "Jim Street",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Lina Esco",
|
||||
"character": "Christina “Chris” Alonso",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Kenny Johnson",
|
||||
"character": "Dominique Luca",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "David Lim",
|
||||
"character": "Victor Tan",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Patrick St. Esprit",
|
||||
"character": "Robert Hicks",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Peter Onorati",
|
||||
"character": "Jeff Mumford",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Stephanie Sigman",
|
||||
"character": "Jessica Cortez",
|
||||
"images": []
|
||||
},
|
||||
{
|
||||
"name": "Amy Farrington",
|
||||
"character": "Piper Lynch",
|
||||
"images": []
|
||||
}
|
||||
],
|
||||
"certification": "TV-14",
|
||||
"added": "2020-05-04T12:01:55.170293Z",
|
||||
"firstAired": "2017-11-02T00:00:00Z",
|
||||
"qualityProfile": {
|
||||
"value": {
|
||||
"name": "HD-720p",
|
||||
"upgradeAllowed": false,
|
||||
"cutoff": 4,
|
||||
"items": [
|
||||
{
|
||||
"quality": {
|
||||
"id": 0,
|
||||
"name": "Unknown",
|
||||
"source": "unknown",
|
||||
"resolution": 0
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 1,
|
||||
"name": "SDTV",
|
||||
"source": "television",
|
||||
"resolution": 480
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"id": 1000,
|
||||
"name": "WEB 480p",
|
||||
"items": [
|
||||
{
|
||||
"quality": {
|
||||
"id": 12,
|
||||
"name": "WEBRip-480p",
|
||||
"source": "webRip",
|
||||
"resolution": 480
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 8,
|
||||
"name": "WEBDL-480p",
|
||||
"source": "web",
|
||||
"resolution": 480
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
}
|
||||
],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 2,
|
||||
"name": "DVD",
|
||||
"source": "dvd",
|
||||
"resolution": 480
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 13,
|
||||
"name": "Bluray-480p",
|
||||
"source": "bluray",
|
||||
"resolution": 480
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 4,
|
||||
"name": "HDTV-720p",
|
||||
"source": "television",
|
||||
"resolution": 720
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 9,
|
||||
"name": "HDTV-1080p",
|
||||
"source": "television",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 10,
|
||||
"name": "Raw-HD",
|
||||
"source": "televisionRaw",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"id": 1001,
|
||||
"name": "WEB 720p",
|
||||
"items": [
|
||||
{
|
||||
"quality": {
|
||||
"id": 14,
|
||||
"name": "WEBRip-720p",
|
||||
"source": "webRip",
|
||||
"resolution": 720
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 5,
|
||||
"name": "WEBDL-720p",
|
||||
"source": "web",
|
||||
"resolution": 720
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
}
|
||||
],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 6,
|
||||
"name": "Bluray-720p",
|
||||
"source": "bluray",
|
||||
"resolution": 720
|
||||
},
|
||||
"items": [],
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"id": 1002,
|
||||
"name": "WEB 1080p",
|
||||
"items": [
|
||||
{
|
||||
"quality": {
|
||||
"id": 15,
|
||||
"name": "WEBRip-1080p",
|
||||
"source": "webRip",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 3,
|
||||
"name": "WEBDL-1080p",
|
||||
"source": "web",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
}
|
||||
],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 7,
|
||||
"name": "Bluray-1080p",
|
||||
"source": "bluray",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 20,
|
||||
"name": "Bluray-1080p Remux",
|
||||
"source": "blurayRaw",
|
||||
"resolution": 1080
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 16,
|
||||
"name": "HDTV-2160p",
|
||||
"source": "television",
|
||||
"resolution": 2160
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"id": 1003,
|
||||
"name": "WEB 2160p",
|
||||
"items": [
|
||||
{
|
||||
"quality": {
|
||||
"id": 17,
|
||||
"name": "WEBRip-2160p",
|
||||
"source": "webRip",
|
||||
"resolution": 2160
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 18,
|
||||
"name": "WEBDL-2160p",
|
||||
"source": "web",
|
||||
"resolution": 2160
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
}
|
||||
],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 19,
|
||||
"name": "Bluray-2160p",
|
||||
"source": "bluray",
|
||||
"resolution": 2160
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"quality": {
|
||||
"id": 21,
|
||||
"name": "Bluray-2160p Remux",
|
||||
"source": "blurayRaw",
|
||||
"resolution": 2160
|
||||
},
|
||||
"items": [],
|
||||
"allowed": false
|
||||
}
|
||||
],
|
||||
"id": 3
|
||||
},
|
||||
"isLoaded": true
|
||||
},
|
||||
"languageProfile": {
|
||||
"value": {
|
||||
"name": "English",
|
||||
"languages": [
|
||||
{
|
||||
"language": {
|
||||
"id": 27,
|
||||
"name": "Hindi"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 26,
|
||||
"name": "Arabic"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 13,
|
||||
"name": "Vietnamese"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 0,
|
||||
"name": "Unknown"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 17,
|
||||
"name": "Turkish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 14,
|
||||
"name": "Swedish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 3,
|
||||
"name": "Spanish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 11,
|
||||
"name": "Russian"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 18,
|
||||
"name": "Portuguese"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 12,
|
||||
"name": "Polish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 15,
|
||||
"name": "Norwegian"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 24,
|
||||
"name": "Lithuanian"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 21,
|
||||
"name": "Korean"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 8,
|
||||
"name": "Japanese"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 5,
|
||||
"name": "Italian"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 9,
|
||||
"name": "Icelandic"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 22,
|
||||
"name": "Hungarian"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 23,
|
||||
"name": "Hebrew"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 20,
|
||||
"name": "Greek"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 4,
|
||||
"name": "German"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 2,
|
||||
"name": "French"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 19,
|
||||
"name": "Flemish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 16,
|
||||
"name": "Finnish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 1,
|
||||
"name": "English"
|
||||
},
|
||||
"allowed": true
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 7,
|
||||
"name": "Dutch"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 6,
|
||||
"name": "Danish"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 25,
|
||||
"name": "Czech"
|
||||
},
|
||||
"allowed": false
|
||||
},
|
||||
{
|
||||
"language": {
|
||||
"id": 10,
|
||||
"name": "Chinese"
|
||||
},
|
||||
"allowed": false
|
||||
}
|
||||
],
|
||||
"upgradeAllowed": false,
|
||||
"cutoff": {
|
||||
"id": 1,
|
||||
"name": "English"
|
||||
},
|
||||
"id": 1
|
||||
},
|
||||
"isLoaded": true
|
||||
},
|
||||
"seasons": [
|
||||
{
|
||||
"seasonNumber": 1,
|
||||
"monitored": false,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasons/328687-1.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"seasonNumber": 2,
|
||||
"monitored": false,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/seasons/5baf03e6b83dd.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"seasonNumber": 3,
|
||||
"monitored": true,
|
||||
"images": [
|
||||
{
|
||||
"coverType": "poster",
|
||||
"url": "https://artworks.thetvdb.com/banners/series/328687/seasons/814708/posters/62060192.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"seasonNumber": 4,
|
||||
"monitored": true,
|
||||
"images": []
|
||||
}
|
||||
],
|
||||
"tags": [],
|
||||
"id": 11
|
||||
},
|
||||
"isLoaded": true
|
||||
},
|
||||
"language": {
|
||||
"id": 1,
|
||||
"name": "English"
|
||||
},
|
||||
"id": 4644
|
||||
},
|
||||
"deleteReason": "upgrade",
|
||||
"eventType": "EpisodeFileDelete"
|
||||
}
|
32
zerver/webhooks/sonarr/fixtures/sonarr_episode_grabbed.json
Normal file
32
zerver/webhooks/sonarr/fixtures/sonarr_episode_grabbed.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"series": {
|
||||
"id": 7,
|
||||
"title": "NCIS",
|
||||
"path": "/home36/adbtech/media/TV Shows/NCIS",
|
||||
"tvdbId": 72108,
|
||||
"tvMazeId": 60,
|
||||
"imdbId": "tt0364845",
|
||||
"type": "standard"
|
||||
},
|
||||
"episodes": [
|
||||
{
|
||||
"id": 8268,
|
||||
"episodeNumber": 10,
|
||||
"seasonNumber": 18,
|
||||
"title": "Watchdog",
|
||||
"airDate": "2021-03-16",
|
||||
"airDateUtc": "2021-03-17T00:00:00Z"
|
||||
}
|
||||
],
|
||||
"release": {
|
||||
"quality": "HDTV-720p",
|
||||
"qualityVersion": 1,
|
||||
"releaseGroup": "MeGusta",
|
||||
"releaseTitle": "NCIS S18E10 720p HEVC x265-MeGusta",
|
||||
"indexer": "IP Torrents - Jackett",
|
||||
"size": 415236096
|
||||
},
|
||||
"downloadClient": "Deluge",
|
||||
"downloadId": "2FBD49EF1D9934F560E4806E001C6DE494D23FD6",
|
||||
"eventType": "Grab"
|
||||
}
|
35
zerver/webhooks/sonarr/fixtures/sonarr_episode_imported.json
Normal file
35
zerver/webhooks/sonarr/fixtures/sonarr_episode_imported.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"series": {
|
||||
"id": 45,
|
||||
"title": "Grey's Anatomy",
|
||||
"path": "/home36/adbtech/media/TV Shows/Grey's Anatomy",
|
||||
"tvdbId": 73762,
|
||||
"tvMazeId": 67,
|
||||
"imdbId": "tt0413573",
|
||||
"type": "standard"
|
||||
},
|
||||
"episodes": [
|
||||
{
|
||||
"id": 8507,
|
||||
"episodeNumber": 9,
|
||||
"seasonNumber": 17,
|
||||
"title": "In My Life",
|
||||
"airDate": "2021-03-25",
|
||||
"airDateUtc": "2021-03-26T01:00:00Z"
|
||||
}
|
||||
],
|
||||
"episodeFile": {
|
||||
"id": 4834,
|
||||
"relativePath": "Season 17/Grey's Anatomy - S17E09 - In My Life HDTV-720p.mkv",
|
||||
"path": "/home36/adbtech/Downloads/Greys.Anatomy.S17E09.720p.HDTV.x264-SYNCOPY/greys.anatomy.s17e09.720p.hdtv.x264-syncopy.mkv",
|
||||
"quality": "HDTV-720p",
|
||||
"qualityVersion": 1,
|
||||
"releaseGroup": "SYNCOPY",
|
||||
"sceneName": "Greys.Anatomy.S17E09.720p.HDTV.x264-SYNCOPY",
|
||||
"size": 832160743
|
||||
},
|
||||
"isUpgrade": false,
|
||||
"downloadClient": "Deluge",
|
||||
"downloadId": "D93392B18D20704D1BE349FA314FACCB7B5DF2C3",
|
||||
"eventType": "Download"
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"series": {
|
||||
"id": 7,
|
||||
"title": "NCIS",
|
||||
"path": "/home36/adbtech/media/TV Shows/NCIS",
|
||||
"tvdbId": 72108,
|
||||
"tvMazeId": 60,
|
||||
"imdbId": "tt0364845",
|
||||
"type": "standard"
|
||||
},
|
||||
"episodes": [
|
||||
{
|
||||
"id": 8268,
|
||||
"episodeNumber": 10,
|
||||
"seasonNumber": 18,
|
||||
"title": "Watchdog",
|
||||
"airDate": "2021-03-16",
|
||||
"airDateUtc": "2021-03-17T00:00:00Z"
|
||||
}
|
||||
],
|
||||
"episodeFile": {
|
||||
"id": 4835,
|
||||
"relativePath": "Season 18/NCIS - S18E10 - Watchdog HDTV-720p.mkv",
|
||||
"path": "/home36/adbtech/Downloads/NCIS.S18E10.720p.HEVC.x265-MeGusta/NCIS.S18E10.720p.HEVC.x265-MeGusta.mkv",
|
||||
"quality": "HDTV-720p",
|
||||
"qualityVersion": 1,
|
||||
"releaseGroup": "MeGusta",
|
||||
"sceneName": "NCIS.S18E10.720p.HEVC.x265-MeGusta",
|
||||
"size": 406824797
|
||||
},
|
||||
"isUpgrade": true,
|
||||
"downloadClient": "Deluge",
|
||||
"downloadId": "2FBD49EF1D9934F560E4806E001C6DE494D23FD6",
|
||||
"deletedFiles": [
|
||||
{
|
||||
"id": 4772,
|
||||
"relativePath": "Season 18/NCIS - S18E10 - Watchdog SDTV.mkv",
|
||||
"path": "/home36/adbtech/media/TV Shows/NCIS/Season 18/NCIS - S18E10 - Watchdog SDTV.mkv",
|
||||
"quality": "SDTV",
|
||||
"qualityVersion": 1,
|
||||
"releaseGroup": "PHOENiX",
|
||||
"sceneName": "NCIS.S18E10.HDTV.x264-PHOENiX",
|
||||
"size": 318197105
|
||||
}
|
||||
],
|
||||
"eventType": "Download"
|
||||
}
|
12
zerver/webhooks/sonarr/fixtures/sonarr_episodes_renamed.json
Normal file
12
zerver/webhooks/sonarr/fixtures/sonarr_episodes_renamed.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"series": {
|
||||
"id": 85,
|
||||
"title": "The L Word",
|
||||
"path": "/home36/adbtech/media/TV Shows/The L Word",
|
||||
"tvdbId": 72477,
|
||||
"tvMazeId": 823,
|
||||
"imdbId": "tt0330251",
|
||||
"type": "standard"
|
||||
},
|
||||
"eventType": "Rename"
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"level": "error",
|
||||
"message": "No indexers available with RSS sync enabled, Sonarr will not grab new releases automatically",
|
||||
"type": "IndexerRssCheck",
|
||||
"wikiUrl": "https://wiki.servarr.com/Sonarr_System#no_indexers_available_with_rss_sync_enabled_sonarr_will_not_grab_new_releases_automatically",
|
||||
"eventType": "Health"
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"level": "warning",
|
||||
"message": "Indexers unavailable due to failures for more than 6 hours: Academic Torrents - Jackett, ACG - Jackett, KickAssTorrent - Jackett, EXT Torrents - Jackett, Extra Torrents - Jackett, SkyTorrents - Jackett, iDope - Jackett",
|
||||
"type": "IndexerLongTermStatusCheck",
|
||||
"wikiUrl": "https://github.com/Sonarr/Sonarr/wiki/Health-checks#indexers-are-unavailable-due-to-failures",
|
||||
"eventType": "Health"
|
||||
}
|
13
zerver/webhooks/sonarr/fixtures/sonarr_series_deleted.json
Normal file
13
zerver/webhooks/sonarr/fixtures/sonarr_series_deleted.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"series": {
|
||||
"id": 90,
|
||||
"title": "Breaking Bad",
|
||||
"path": "/home36/adbtech/media/TV Shows/Breaking Bad",
|
||||
"tvdbId": 81189,
|
||||
"tvMazeId": 169,
|
||||
"imdbId": "tt0903747",
|
||||
"type": "standard"
|
||||
},
|
||||
"deletedFiles": true,
|
||||
"eventType": "SeriesDelete"
|
||||
}
|
19
zerver/webhooks/sonarr/fixtures/sonarr_test.json
Normal file
19
zerver/webhooks/sonarr/fixtures/sonarr_test.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"series": {
|
||||
"id": 1,
|
||||
"title": "Test Title",
|
||||
"path": "C:\\testpath",
|
||||
"tvdbId": 1234,
|
||||
"tvMazeId": 0,
|
||||
"type": "standard"
|
||||
},
|
||||
"episodes": [
|
||||
{
|
||||
"id": 123,
|
||||
"episodeNumber": 1,
|
||||
"seasonNumber": 1,
|
||||
"title": "Test title"
|
||||
}
|
||||
],
|
||||
"eventType": "Test"
|
||||
}
|
89
zerver/webhooks/sonarr/tests.py
Normal file
89
zerver/webhooks/sonarr/tests.py
Normal file
@@ -0,0 +1,89 @@
|
||||
from zerver.lib.test_classes import WebhookTestCase
|
||||
|
||||
|
||||
class SonarrHookTests(WebhookTestCase):
|
||||
STREAM_NAME = "sonarr"
|
||||
URL_TEMPLATE = "/api/v1/external/sonarr?api_key={api_key}&stream={stream}"
|
||||
FIXTURE_DIR_NAME = "sonarr"
|
||||
|
||||
def test_sonarr_test(self) -> None:
|
||||
"""
|
||||
Tests if sonarr test payload is handled correctly
|
||||
"""
|
||||
expected_topic = "Sonarr - Test"
|
||||
expected_message = "Sonarr webhook has been successfully configured."
|
||||
self.check_webhook("sonarr_test", expected_topic, expected_message)
|
||||
|
||||
def test_sonarr_series_deleted(self) -> None:
|
||||
"""
|
||||
Tests if sonarr series deleted payload is handled correctly
|
||||
"""
|
||||
expected_topic = "Breaking Bad"
|
||||
expected_message = "Breaking Bad has been deleted."
|
||||
self.check_webhook("sonarr_series_deleted", expected_topic, expected_message)
|
||||
|
||||
def test_sonarr_health_check_warning(self) -> None:
|
||||
"""
|
||||
Tests if sonarr health check warning payload is handled correctly
|
||||
"""
|
||||
expected_topic = "Health warning"
|
||||
expected_message = "Indexers unavailable due to failures for more than 6 hours: Academic Torrents - Jackett, ACG - Jackett, KickAssTorrent - Jackett, EXT Torrents - Jackett, Extra Torrents - Jackett, SkyTorrents - Jackett, iDope - Jackett."
|
||||
self.check_webhook("sonarr_health_check_warning", expected_topic, expected_message)
|
||||
|
||||
def test_sonarr_health_check_error(self) -> None:
|
||||
"""
|
||||
Tests if sonarr health check error payload is handled correctly
|
||||
"""
|
||||
expected_topic = "Health error"
|
||||
expected_message = "No indexers available with RSS sync enabled, Sonarr will not grab new releases automatically."
|
||||
self.check_webhook("sonarr_health_check_error", expected_topic, expected_message)
|
||||
|
||||
def test_sonarr_episodes_renamed(self) -> None:
|
||||
"""
|
||||
Tests if sonarr episodes renamed payload is handled correctly
|
||||
"""
|
||||
expected_topic = "The L Word"
|
||||
expected_message = "The L Word episodes have been renamed."
|
||||
self.check_webhook("sonarr_episodes_renamed", expected_topic, expected_message)
|
||||
|
||||
def test_sonarr_episode_imported(self) -> None:
|
||||
"""
|
||||
Tests if sonarr episode imported payload is handled correctly
|
||||
"""
|
||||
expected_topic = "Grey's Anatomy"
|
||||
expected_message = "Grey's Anatomy - 17x9 - In My Life has been imported."
|
||||
self.check_webhook("sonarr_episode_imported", expected_topic, expected_message)
|
||||
|
||||
def test_sonarr_episode_imported_upgrade(self) -> None:
|
||||
"""
|
||||
Tests if sonarr episode imported upgrade payload is handled correctly
|
||||
"""
|
||||
expected_topic = "NCIS"
|
||||
expected_message = "NCIS - 18x10 - Watchdog has been upgraded from SDTV to HDTV-720p."
|
||||
self.check_webhook("sonarr_episode_imported_upgrade", expected_topic, expected_message)
|
||||
|
||||
def test_sonarr_episode_grabbed(self) -> None:
|
||||
"""
|
||||
Tests if sonarr episode grabbed payload is handled correctly
|
||||
"""
|
||||
expected_topic = "NCIS"
|
||||
expected_message = "NCIS - 18x10 - Watchdog has been grabbed."
|
||||
self.check_webhook("sonarr_episode_grabbed", expected_topic, expected_message)
|
||||
|
||||
def test_sonarr_episode_deleted(self) -> None:
|
||||
"""
|
||||
Tests if sonarr episode deleted payload is handled correctly
|
||||
"""
|
||||
expected_topic = "Breaking Bad"
|
||||
expected_message = "Breaking Bad - 1x1 - Pilot has been deleted."
|
||||
self.check_webhook("sonarr_episode_deleted", expected_topic, expected_message)
|
||||
|
||||
def test_sonarr_episode_deleted_upgrade(self) -> None:
|
||||
"""
|
||||
Tests if sonarr episode deleted upgrade payload is handled correctly
|
||||
"""
|
||||
expected_topic = "S.W.A.T. (2017)"
|
||||
expected_message = (
|
||||
"S.W.A.T. (2017) - 4x10 - Buried has been deleted due to quality upgrade."
|
||||
)
|
||||
self.check_webhook("sonarr_episode_deleted_upgrade", expected_topic, expected_message)
|
147
zerver/webhooks/sonarr/view.py
Normal file
147
zerver/webhooks/sonarr/view.py
Normal file
@@ -0,0 +1,147 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import REQ, has_request_variables, webhook_view
|
||||
from zerver.lib.exceptions import UnsupportedWebhookEventType
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.lib.webhooks.common import check_send_webhook_message, get_setup_webhook_message
|
||||
from zerver.models import UserProfile
|
||||
|
||||
SONARR_TOPIC_TEMPLATE = "{series_title}".strip()
|
||||
SONARR_TOPIC_TEMPLATE_TEST = "Sonarr - Test".strip()
|
||||
SONARR_TOPIC_TEMPLATE_HEALTH_CHECK = "Health {level}".strip()
|
||||
|
||||
SONARR_MESSAGE_TEMPLATE_SERIES_DELETED = "{series_title} has been deleted.".strip()
|
||||
SONARR_MESSAGE_TEMPLATE_HEALTH_CHECK = "{message}.".strip()
|
||||
SONARR_MESSAGE_TEMPLATE_EPISODES_RENAMED = "{series_title} episodes have been renamed.".strip()
|
||||
SONARR_MESSAGE_TEMPLATE_EPISODE_IMPORTED = (
|
||||
"{series_title} - {series_number}x{episode_number} - {episode_name} has been imported.".strip()
|
||||
)
|
||||
SONARR_MESSAGE_TEMPLATE_EPISODE_IMPORTED_UPGRADE = "{series_title} - {series_number}x{episode_number} - {episode_name} has been upgraded from {old_quality} to {new_quality}.".strip()
|
||||
SONARR_MESSAGE_TEMPLATE_EPISODE_GRABBED = (
|
||||
"{series_title} - {series_number}x{episode_number} - {episode_name} has been grabbed.".strip()
|
||||
)
|
||||
SONARR_MESSAGE_TEMPLATE_EPISODE_DELETED = (
|
||||
"{series_title} - {series_number}x{episode_number} - {episode_name} has been deleted.".strip()
|
||||
)
|
||||
SONARR_MESSAGE_TEMPLATE_EPISODE_DELETED_UPGRADE = "{series_title} - {series_number}x{episode_number} - {episode_name} has been deleted due to quality upgrade.".strip()
|
||||
|
||||
|
||||
@webhook_view("Sonarr")
|
||||
@has_request_variables
|
||||
def api_sonarr_webhook(
|
||||
request: HttpRequest,
|
||||
user_profile: UserProfile,
|
||||
payload: Dict[str, Any] = REQ(argument_type="body"),
|
||||
) -> HttpResponse:
|
||||
body = get_body_for_http_request(payload)
|
||||
subject = get_subject_for_http_request(payload)
|
||||
|
||||
check_send_webhook_message(request, user_profile, subject, body)
|
||||
return json_success()
|
||||
|
||||
|
||||
def get_subject_for_http_request(payload: Dict[str, Any]) -> str:
|
||||
if payload["eventType"] != "Test" and payload["eventType"] != "Health":
|
||||
topic = SONARR_TOPIC_TEMPLATE.format(series_title=payload["series"]["title"])
|
||||
elif payload["eventType"] == "Test":
|
||||
topic = SONARR_TOPIC_TEMPLATE_TEST
|
||||
elif payload["eventType"] == "Health":
|
||||
topic = SONARR_TOPIC_TEMPLATE_HEALTH_CHECK.format(level=payload["level"])
|
||||
|
||||
return topic
|
||||
|
||||
|
||||
def get_body_for_health_check_event(payload: Dict[str, Any]) -> str:
|
||||
return SONARR_MESSAGE_TEMPLATE_HEALTH_CHECK.format(message=payload["message"])
|
||||
|
||||
|
||||
def get_body_for_episodes_renamed_event(payload: Dict[str, Any]) -> str:
|
||||
return SONARR_MESSAGE_TEMPLATE_EPISODES_RENAMED.format(series_title=payload["series"]["title"])
|
||||
|
||||
|
||||
def get_body_for_series_deleted_event(payload: Dict[str, Any]) -> str:
|
||||
return SONARR_MESSAGE_TEMPLATE_SERIES_DELETED.format(series_title=payload["series"]["title"])
|
||||
|
||||
|
||||
def get_body_for_episode_imported_upgrade_event(payload: Dict[str, Any]) -> str:
|
||||
data = {
|
||||
"series_title": payload["series"]["title"],
|
||||
"series_number": payload["episodes"][0]["seasonNumber"],
|
||||
"episode_number": payload["episodes"][0]["episodeNumber"],
|
||||
"episode_name": payload["episodes"][0]["title"],
|
||||
"new_quality": payload["episodeFile"]["quality"],
|
||||
"old_quality": payload["deletedFiles"][0]["quality"],
|
||||
}
|
||||
|
||||
return SONARR_MESSAGE_TEMPLATE_EPISODE_IMPORTED_UPGRADE.format(**data)
|
||||
|
||||
|
||||
def get_body_for_episode_imported_event(payload: Dict[str, Any]) -> str:
|
||||
data = {
|
||||
"series_title": payload["series"]["title"],
|
||||
"series_number": payload["episodes"][0]["seasonNumber"],
|
||||
"episode_number": payload["episodes"][0]["episodeNumber"],
|
||||
"episode_name": payload["episodes"][0]["title"],
|
||||
}
|
||||
|
||||
return SONARR_MESSAGE_TEMPLATE_EPISODE_IMPORTED.format(**data)
|
||||
|
||||
|
||||
def get_body_for_episode_grabbed_event(payload: Dict[str, Any]) -> str:
|
||||
data = {
|
||||
"series_title": payload["series"]["title"],
|
||||
"series_number": payload["episodes"][0]["seasonNumber"],
|
||||
"episode_number": payload["episodes"][0]["episodeNumber"],
|
||||
"episode_name": payload["episodes"][0]["title"],
|
||||
}
|
||||
|
||||
return SONARR_MESSAGE_TEMPLATE_EPISODE_GRABBED.format(**data)
|
||||
|
||||
|
||||
def get_body_for_episode_deleted_upgrade_event(payload: Dict[str, Any]) -> str:
|
||||
data = {
|
||||
"series_title": payload["series"]["title"],
|
||||
"series_number": payload["episodes"][0]["seasonNumber"],
|
||||
"episode_number": payload["episodes"][0]["episodeNumber"],
|
||||
"episode_name": payload["episodes"][0]["title"],
|
||||
}
|
||||
|
||||
return SONARR_MESSAGE_TEMPLATE_EPISODE_DELETED_UPGRADE.format(**data)
|
||||
|
||||
|
||||
def get_body_for_episode_deleted_event(payload: Dict[str, Any]) -> str:
|
||||
data = {
|
||||
"series_title": payload["series"]["title"],
|
||||
"series_number": payload["episodes"][0]["seasonNumber"],
|
||||
"episode_number": payload["episodes"][0]["episodeNumber"],
|
||||
"episode_name": payload["episodes"][0]["title"],
|
||||
}
|
||||
|
||||
return SONARR_MESSAGE_TEMPLATE_EPISODE_DELETED.format(**data)
|
||||
|
||||
|
||||
def get_body_for_http_request(payload: Dict[str, Any]) -> str:
|
||||
if payload["eventType"] == "Test":
|
||||
return get_setup_webhook_message("Sonarr")
|
||||
elif payload["eventType"] == "Health":
|
||||
return get_body_for_health_check_event(payload)
|
||||
elif payload["eventType"] == "Rename":
|
||||
return get_body_for_episodes_renamed_event(payload)
|
||||
elif payload["eventType"] == "SeriesDelete":
|
||||
return get_body_for_series_deleted_event(payload)
|
||||
elif payload["eventType"] == "Download" and "isUpgrade" in payload:
|
||||
if payload["isUpgrade"]:
|
||||
return get_body_for_episode_imported_upgrade_event(payload)
|
||||
else:
|
||||
return get_body_for_episode_imported_event(payload)
|
||||
elif payload["eventType"] == "Grab":
|
||||
return get_body_for_episode_grabbed_event(payload)
|
||||
elif payload["eventType"] == "EpisodeFileDelete" and "deleteReason" in payload:
|
||||
if payload["deleteReason"] == "upgrade":
|
||||
return get_body_for_episode_deleted_upgrade_event(payload)
|
||||
else:
|
||||
return get_body_for_episode_deleted_event(payload)
|
||||
else:
|
||||
raise UnsupportedWebhookEventType(payload["eventType"])
|
Reference in New Issue
Block a user