smirgol / plugin.video.crunchyroll

Watch videos from the anime platform Crunchyroll.com on Kodi
GNU Affero General Public License v3.0
46 stars 11 forks source link

refactor: The same code, three times, it's a lot! #19

Closed lumiru closed 6 months ago

lumiru commented 6 months ago
smirgol commented 6 months ago

lolwut? Maybe a title what it actually does or some description would help. ;-D I'll read through that tomorrow.

lumiru commented 6 months ago

lolwut? Maybe a title what it actually does or some description would help. ;-D I'll read through that tomorrow.

I add explanations. The main purpose is the first bullet point, the next ones are mainly splitted functions to encourage homogeneous behaviour.

smirgol commented 6 months ago

Thank you! So much easier to understand what it is supposed to do without studying the (large amount) of changes. :)

The reason for the code duplication is that these parts in the version for the old api were very different in what data they have put into the list. I improved on that a lot by using the DTOs already, but didn't find the time yet to make things even more nicer. So that's a good idea to do it, while it's not an easy task - pagination, callbacks, ... :)

smirgol commented 6 months ago

Looks good to me so far.

I've cleaned it up, fixed the return types and commented out the args.thumb and args.fanart in controller.py, as we no longer have those in the args as of #21