Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(movie): Resolution should be a string, not int #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kevcenteno
Copy link

Pretty straightforward

@SkYNewZ SkYNewZ self-assigned this Dec 9, 2020
@SkYNewZ
Copy link
Owner

SkYNewZ commented Dec 9, 2020

Thanks for this first contribution !

After some tries, I can see that alternativeTitles[].language type's does not change, this is always a JSON object:
screenshot

I have also tried on the new Radarr API v3 and I have the same result. Can you tell me why you think that alternativeTitles[].language type's should be changed ?

Moreover, for the resolution part, its seems to be the same thing, nothing changed on the Radarr side. Can you confirm ?

@SkYNewZ SkYNewZ added the invalid This doesn't seem right label Dec 9, 2020
@kevcenteno
Copy link
Author

Strange... I'm on version 0.2.0.1480 which uses the response structure in the PR

@SkYNewZ
Copy link
Owner

SkYNewZ commented Dec 10, 2020

Hum can you show me please ?

@kevcenteno
Copy link
Author

I don't know what there is to show... The struct and test data reflect what I'm seeing

@SkYNewZ
Copy link
Owner

SkYNewZ commented Dec 10, 2020

As you can see here https://radarr.video/docs/api/#/Movie/getMovie, this sdk is deprecated regarding the Radarr API v3.

My tests

Version v3.0.1.4251
docker run -d \                                                   
  --name=radarr \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -p 127.0.0.1:7878:7878 \
  ghcr.io/linuxserver/radarr:amd64-3.0.1.4251-ls3

and this is the output of GET /movie, look at the alternativeTitles[].language:

[
  {
    "title": "Batman: Death in the Family",
    "alternativeTitles": [
      {
        "sourceType": "tmdb",
        "movieId": 1,
        "title": "DC Showcase Shorts: Batman: Death in the Family",
        "sourceId": 0,
        "votes": 0,
        "voteCount": 0,
        "language": {
          "id": 1,
          "name": "English"
        },
        "id": 1
      },
      {
        "sourceType": "tmdb",
        "movieId": 1,
        "title": "DC展台:蝙蝠侠:家庭之死",
        "sourceId": 0,
        "votes": 0,
        "voteCount": 0,
        "language": {
          "id": 1,
          "name": "English"
        },
        "id": 2
      },
      {
        "sourceType": "tmdb",
        "movieId": 1,
        "title": "蝙蝠俠:家人之死",
        "sourceId": 0,
        "votes": 0,
        "voteCount": 0,
        "language": {
          "id": 1,
          "name": "English"
        },
        "id": 3
      },
      {
        "sourceType": "tmdb",
        "movieId": 1,
        "title": "蝙蝠俠:家族之死",
        "sourceId": 0,
        "votes": 0,
        "voteCount": 0,
        "language": {
          "id": 1,
          "name": "English"
        },
        "id": 4
      }
    ],
    "secondaryYearSourceId": 0,
    "sortTitle": "batman death in family",
    "sizeOnDisk": 0,
    "status": "released",
    "overview": "Tragedy strikes the Batman's life again when Robin Jason Todd tracks down his birth mother only to run afoul of the Joker. An adaptation of the 1988 comic book storyline of the same name.",
    "physicalRelease": "2020-10-13T00:00:00Z",
    "images": [
      {
        "coverType": "poster",
        "url": "/MediaCover/1/poster.jpg?lastWrite=637432400071086265",
        "remoteUrl": "https://image.tmdb.org/t/p/original/k8Q9ulyRE8fkvZMkAM9LPYMKctb.jpg"
      },
      {
        "coverType": "fanart",
        "url": "/MediaCover/1/fanart.jpg?lastWrite=637432400071756265",
        "remoteUrl": "https://image.tmdb.org/t/p/original/kU7ZiyeUwcpTkYj3UcxSqGdZmxY.jpg"
      }
    ],
    "website": "",
    "downloaded": false,
    "year": 2020,
    "hasFile": false,
    "youTubeTrailerId": "TGjF_Gal67w",
    "studio": "Warner Bros. Animation",
    "path": "/movies/Batman Death in the Family (2020)",
    "profileId": 1,
    "monitored": true,
    "minimumAvailability": "announced",
    "isAvailable": true,
    "folderName": "/movies/Batman Death in the Family (2020)",
    "runtime": 96,
    "lastInfoSync": "2020-12-10T23:33:26.9273728Z",
    "cleanTitle": "batmandeathinfamily",
    "imdbId": "tt12794046",
    "tmdbId": 618353,
    "titleSlug": "618353",
    "certification": "R",
    "genres": [
      "Animation",
      "Action"
    ],
    "tags": [],
    "added": "2020-12-10T23:33:26.7572022Z",
    "ratings": {
      "votes": 114,
      "value": 7.2
    },
    "qualityProfileId": 1,
    "id": 1
  }
]
Version v0.2.0.1504

Same endpoint

{
    "added": "2020-12-10T23:44:10.777143Z",
    "alternativeTitles": [
        {
            "id": 1,
            "language": "english",
            "movieId": 3,
            "sourceId": 18785,
            "sourceType": "tmdb",
            "title": "Perico",
            "voteCount": 0,
            "votes": 0
        },
        {
            "id": 2,
            "language": "english",
            "movieId": 3,
            "sourceId": 18785,
            "sourceType": "tmdb",
            "title": "Una Notte Da Leoni",
            "voteCount": 0,
            "votes": 0
        },
        {
            "id": 3,
            "language": "english",
            "movieId": 3,
            "sourceId": 18785,
            "sourceType": "tmdb",
            "title": "The Hangover 2009",
            "voteCount": 0,
            "votes": 0
        },
        {
            "id": 4,
            "language": "english",
            "movieId": 3,
            "sourceId": 18785,
            "sourceType": "tmdb",
            "title": "Resacón en las Vegas",
            "voteCount": 0,
            "votes": 0
        },
        {
            "id": 5,
            "language": "english",
            "movieId": 3,
            "sourceId": 18785,
            "sourceType": "tmdb",
            "title": "The Hangover: Theatrical Version",
            "voteCount": 0,
            "votes": 0
        },
        {
            "id": 6,
            "language": "english",
            "movieId": 3,
            "sourceId": 18785,
            "sourceType": "tmdb",
            "title": "Hangover, the 01 Hangover, The",
            "voteCount": 0,
            "votes": 0
        },
        {
            "id": 7,
            "language": "english",
            "movieId": 3,
            "sourceId": 18785,
            "sourceType": "tmdb",
            "title": "Hangover, The",
            "voteCount": 0,
            "votes": 0
        }
    ],
    "cleanTitle": "thehangover",
    "downloaded": false,
    "folderName": "/movies/The Hangover (2009)",
    "genres": [],
    "hasFile": false,
    "id": 3,
    "images": [
        {
            "coverType": "poster",
            "url": "/MediaCover/3/poster.jpg"
        },
        {
            "coverType": "fanart",
            "url": "/MediaCover/3/fanart.jpg"
        }
    ],
    "imdbId": "tt1119646",
    "inCinemas": "2009-06-01T23:00:00Z",
    "isAvailable": true,
    "lastInfoSync": "2020-12-10T23:44:10.863913Z",
    "minimumAvailability": "announced",
    "monitored": true,
    "overview": "When three friends finally come to after a raucous night of bachelor-party revelry, they find a baby in the closet and a tiger in the bathroom. But they can't seem to locate their best friend, Doug – who's supposed to be tying the knot. Launching a frantic search for Doug, the trio perseveres through a nasty hangover to try to make it to the church on time.",
    "path": "/movies/The Hangover (2009)",
    "pathState": "static",
    "physicalRelease": "2010-05-19T00:00:00Z",
    "profileId": 1,
    "qualityProfileId": 1,
    "ratings": {
        "value": 7.3,
        "votes": 12742
    },
    "runtime": 100,
    "secondaryYearSourceId": 0,
    "sizeOnDisk": 0,
    "sortTitle": "hangover",
    "status": "released",
    "studio": "Legendary Pictures",
    "tags": [],
    "title": "The Hangover",
    "titleSlug": "the-hangover-18785",
    "tmdbId": 18785,
    "website": "http://hangoverpart2.warnerbros.com/dvd/",
    "year": 2009,
    "youTubeTrailerId": "jj6wcUes1no"
}

Indeed, the language is a string ! And maybe the resolution too but I do not use Radarr anymore so I don't have any movie files dowloaded by Radarr and can't test it. But I coded this, so I conclude that this key must be there.

So, this sdk is simply not compatible with Radarr version v0.2.X whereas it is with Radarr version v3.0.X.

@SkYNewZ
Copy link
Owner

SkYNewZ commented Dec 11, 2020

With a downloaded movie to ensure resolution type changed, the answer is no, always in a Radarr version v3.0.1.4251:

{
  "title": "Chouchou",
  "alternativeTitles": [
    {
      "sourceType": "tmdb",
      "movieId": 1,
      "title": "Szívem csücske: Chouchou",
      "sourceId": 0,
      "votes": 0,
      "voteCount": 0,
      "language": {
        "id": 22,
        "name": "Hungarian"
      },
      "id": 1
    }
  ],
  "secondaryYearSourceId": 0,
  "sortTitle": "chouchou",
  "sizeOnDisk": 1529008169,
  "status": "released",
  "overview": "Choukri, alias Chouchou, a transvestite Maghrebi with clear eyes, comes illegally to Paris to find his nephew. Hired as an assistant by a psychotherapist, known for his good mood, he also work as a waiter in a transvestite cabaret of Clichy where he meets Stanislas.",
  "inCinemas": "2003-03-19T00:00:00Z",
  "physicalRelease": "0001-01-01T00:00:00Z",
  "images": [
    {
      "coverType": "poster",
      "url": "/MediaCover/1/poster.jpg?lastWrite=637432421590106897"
    },
    {
      "coverType": "fanart",
      "url": "/MediaCover/1/fanart.jpg?lastWrite=637432421590716897"
    }
  ],
  "website": "http://www.warnerbros.fr/movies/chouchou/",
  "downloaded": true,
  "year": 2003,
  "hasFile": true,
  "youTubeTrailerId": "",
  "studio": "Fechner Audiovisuel",
  "path": "/movies/Chouchou (2003)",
  "profileId": 1,
  "monitored": true,
  "minimumAvailability": "announced",
  "isAvailable": true,
  "folderName": "/movies/Chouchou (2003)",
  "runtime": 105,
  "lastInfoSync": "2020-12-11T00:11:34.8884227Z",
  "cleanTitle": "chouchou",
  "imdbId": "tt0328955",
  "tmdbId": 17684,
  "titleSlug": "17684",
  "genres": [
    "Comedy"
  ],
  "tags": [],
  "added": "2020-12-11T00:09:18.7117638Z",
  "ratings": {
    "votes": 347,
    "value": 5.3
  },
  "movieFile": {
    "movieId": 0,
    "relativePath": "Chouchou.2003.FRENCH.1080p.WEBDL.H264-Ducks.mp4",
    "size": 1529008169,
    "dateAdded": "2020-12-11T00:11:35.3709309Z",
    "sceneName": "",
    "quality": {
      "quality": {
        "id": 3,
        "name": "WEBDL-1080p",
        "source": "webdl",
        "resolution": 1080,
        "modifier": "none"
      },
      "revision": {
        "version": 1,
        "real": 0,
        "isRepack": false
      }
    },
    "edition": "",
    "mediaInfo": {
      "containerFormat": "MPEG-4",
      "videoFormat": "AVC",
      "videoCodecID": "avc1",
      "videoProfile": "High@L4",
      "videoCodecLibrary": "",
      "videoBitrate": 1813709,
      "videoBitDepth": 8,
      "videoMultiViewCount": 0,
      "videoColourPrimaries": "",
      "videoTransferCharacteristics": "",
      "width": 1920,
      "height": 1080,
      "audioFormat": "E-AC-3",
      "audioCodecID": "ec-3",
      "audioCodecLibrary": "",
      "audioAdditionalFeatures": "",
      "audioBitrate": 128000,
      "runTime": "01:44:41.1670000",
      "audioStreamCount": 1,
      "audioChannels": 0,
      "audioChannelPositions": "2/0/0",
      "audioChannelPositionsText": "",
      "audioProfile": "",
      "videoFps": 24,
      "audioLanguages": "French",
      "subtitles": "",
      "scanType": "Progressive",
      "schemaRevision": 6
    },
    "id": 1
  },
  "qualityProfileId": 1,
  "id": 1
}

We can see "resolution": 1080 where resolution is an integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants