bpwhelan / EmbyAniSync

Sync Emby anime library to AniList
GNU General Public License v3.0
11 stars 3 forks source link

Absolute watched episode #7

Closed epicawk closed 4 weeks ago

epicawk commented 10 months ago

Plugin been working great except for One Piece, my only serie set in Absolute instead of Aired. I have episode 1-770 marked as played in Emby.

[ANILIST] Episodes watched was higher on AniList [768] than on Emby [2] so skipping update

bpwhelan commented 10 months ago

Guess default github behavior is to not send me an email when someone opens an issue >.< Sorry for late response.

I think this might require some work... I remember messing with this and the api seems to not care how you have the series displayed... I will have to test again though.

bpwhelan commented 10 months ago

Hmmm, It seems to work for me, Here is how I have mine setup for shippuden. image image

bpwhelan commented 10 months ago
{
  "Items": [
    {
      "Name": "Naruto Shippuden",
      "ServerId": "",
      "Id": "9653",
      "SortName": "Naruto Shippuden",
      "RunTimeTicks": 13800000000,
      "ProductionYear": 2007,
      "ProviderIds": {
        "Tvdb": "79824",
        "IMDB": "tt0988824",
        "Tmdb": "31910",
        "AniList": "1735",
        "AniDB": "4880",
        "MyAnimeList": "1735"
      },
      "IsFolder": true,
      "Type": "Series",
      "UserData": {
        "PlayedPercentage": 2.4000000000000057,
        "UnplayedItemCount": 488,
        "PlaybackPositionTicks": 0,
        "PlayCount": 0,
        "IsFavorite": false,
        "Played": false
      },
      "RecursiveItemCount": 500,
      "AirDays": [],
      "ImageTags": {
        "Primary": "",
        "Logo": ""
      },
      "BackdropImageTags": [
        ""
      ],
      "EndDate": "2017-03-23T04:00:00.0000000Z"
    }
  ],
  "TotalRecordCount": 1
}

This is the result of the query that gets run. RecursiveItemCount - UnplayedItemCount is what I look at in the script.

epicawk commented 10 months ago

Not sure if this can help but I don't have all the episodes but they are marked as played. image

bpwhelan commented 10 months ago

Hmmm, I'm not really sure.... I tested both the webhook method and scheduled update and both seem to be aware that it's a single season show and does the math accordingly.

What may help is if you can post the server response to this call. This would be what the script looks at to determine play status

https://emby_url.example/emby/Items?Recursive=true&Fields=ProviderIds%2CRecursiveItemCount%2CSortName%2CProductionYear&IncludeItemTypes=Series%2CSeason&Ids={SERIES_ID}%2C{SEASON_ID}&UserId={USER_ID}&api_key={API_KEY}

You can find series_id and season_id in the url of the show/season. Make sure you remove the server id and other private info from the json. I don't think any of it is actionable, but it's better to stay safe.

bpwhelan commented 4 weeks ago

Don't think this is an issue, I've personally tested this and can't get any extra info.