Conversation
for issue z411#660
|
Apologies if this isn't quite correct / good. I don't know python that much. |
faster than info
|
|
||
| def do_list_json(self, args): | ||
| """ | ||
| Print list of shows in json format. |
There was a problem hiding this comment.
Should mention that each entry is printed as a JSON line on its own (instead of an array). At least right now.
If we were to consider things like the scoring format, it may be useful to also report that in a meta object on its own, in which case the question follows whether the entries should instead be wrapped in an array to build an object as follows:
{ "account": "string", "api": "string", "has_progress": false, "scoring_format": "enum", "entries": [{…}] }I don't now how the scoring format options in anilist are implemented currently in various parts of the code or whether it makes more sense to instead specify a max_score to be of either 3, 5, or 10 (and use the latter for 10, 20, and 100-point schemas).
And that it is intended to be used by third-party tools.
There was a problem hiding this comment.
For my particular usage, each entry being on its own line is better. In case another shell program wants to use this, I think it might be better to leave it like this.
The scoring format is something I was simply wondering about, but I think is a good idea to investigate.
There was a problem hiding this comment.
I'll leave this unresolved for @z411 to read (also the description hasn't been updated).
reverts 0b1137e
Co-authored-by: FichteFoll <fichtefoll2@googlemail.com>
this should be useful in my adl script
For issue #660
If you merge this PR, please squash and merge.
Example of
trackma list_json(it defaults to watching list){"title": "Ars no Kyojuu", "current_episode": "2", "total_episodes": "12", "score": "0", "status": "Ongoing", "estimated_aired_episode": "2", "image": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx155089-I5zYFNvWua57.png"} {"title": "Blue Lock", "current_episode": "14", "total_episodes": "24", "score": "5.5", "status": "Ongoing", "estimated_aired_episode": "14", "image": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx137822-4dVWMSHLpGf8.png"} {"title": "Buddy Daddies", "current_episode": "2", "total_episodes": "13", "score": "0", "status": "Ongoing", "estimated_aired_episode": "2", "image": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx155907-gR7aRwVHwrjc.jpg"} {"title": "Bungou Stray Dogs 4th Season", "current_episode": "2", "total_episodes": "13", "score": "0", "status": "Ongoing", "estimated_aired_episode": "2", "image": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx141249-8tjavEDHmLoT.jpg"} {"title": "Flying Witch", "current_episode": "12", "total_episodes": "12", "score": "0", "status": "Finished", "image": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx21284-vQcCLIWt1o5O.png"}Then it also can accept list status,
trackma list_json paused:{"title": "Casshern Sins", "current_episode": "15", "total_episodes": "24", "score": "6", "status": "Finished", "image": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx4981-V6MbMiJUqdvP.jpg"} {"title": "Chi's Sweet Home: Atarashii Ouchi", "current_episode": "63", "total_episodes": "104", "score": "0", "status": "Finished", "image": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx6024-eYiQMRfPfWiF.jpg"} {"title": "Joshiraku", "current_episode": "1", "total_episodes": "13", "score": "0", "status": "Finished", "image": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx12679-0zlvLP7KyxjH.png"} {"title": "Karakai Jouzu no Takagi-san 2", "current_episode": "7", "total_episodes": "12", "score": "5", "status": "Finished", "image": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/bx107068-KJq0eFP0GTjL.jpg"}I believe
trackma -ashould work. I tested withtrackma -a 2 list_jsonand it asks me to select account first, before listing anything.In bash scripts,
jqworks as expected. Here is a more complicated command: