ShokoAnime / ShokoServer

Repository for Shoko Server.
http://shokoanime.com/shoko-server/
MIT License
374 stars 74 forks source link

Feat: Add overview property to the webui's filesummary endpoint #1128

Closed fearnlj01 closed 1 month ago

fearnlj01 commented 1 month ago

The motivation for this addition is to ensure that, regardless of what the WebUI requests, we always have the same information available for the file overview panel.

I've tested the changes on my end, but I've not got much mixed media, so I cannot explicitly testify to the robustness of the changes, just that it works on 'typical' & empty series...

Separately, I have provisional changes ready for the series redesign PR for the web ui, so the changes in this PR should actually be utilised if everything on that end gets merged.

harshithmohan commented 1 month ago

Can you what it looks like on the webui?

fearnlj01 commented 1 month ago

Can you what it looks like on the webui?

Just to quickly reply to this as it's a quick one... (I'll pick up on the reset when I'm back home)

As pictured below, this shouldn't change how anything is presented in the WebUI (But always stays the same, even if not grouping by ReleaseGroup/FileSource...). image

An example response is as per the below:

{
  "Overview": {
    "SourcesByType": [
      {
        "Type": "Normal",
        "Sources": [
          { "Type": "Web", "Count": 11 },
          { "Type": "Unknown", "Count": 1 }
        ]
      }
    ],
    "TotalFileSize": 17355339539,
    "ReleaseGroups": ["SomeAnimeGroup"]
  },
  "Groups": [
    {
      "GroupName": "SomeAnimeGroup",
      "GroupNameShort": "SomeAnimeGroup",
      "FileVersion": 1,
      "FileLocation": "F:\\Anime\\SomeAnime2",
      "VideoResolution": "1080p",
      "VideoWidth": 1920,
      "VideoHeight": 1080,
      "AudioLanguages": ["jpn"],
      "SubtitleLanguages": ["eng"],
      "RangeByType": {
        "Normal": { "Count": 12, "Range": "01-12", "FileSize": 17355339539 }
      }
    }
  ],
  "MissingEpisodes": []
}
fearnlj01 commented 1 month ago

I've not made amendments 100% inline with feedback, but should've addressed everything whilst making things a bit more readable in the process.

(And it's a bit late with the edit, but thank you for all the feedback)

ElementalCrisis commented 1 month ago

@revam review and merge please if everything is good to go.