Coder Social home page Coder Social logo

Comments (5)

rainyroads avatar rainyroads commented on June 12, 2024 2

Yeah, that's fine. I was just surprised by it being a list since the annotation said it would always be an optional str.

It actually should always be either a string or None, if it's returning a list here I'd consider that a bug.

I'd rather not change it to return a preformated comma-separated list. What about adding an authors attribute that is always a list instead here? This would contain all authors if there are multiple, or a list of just one author if there is one.

But as for author_name returning a list here, that is a bug and I'll have a fix submitted for that.

from pysaucenao.

Myned avatar Myned commented on June 12, 2024

The author_name attribute accounts for this by returning only the first creator in that list:
https://github.com/FujiMakoto/pysaucenao/blob/3c6ac752413491a359b7948bc55abf4efe936519/pysaucenao/containers.py#L290-L292
If you need the complete list, then a change is required, either through a pull request, forking, or overriding the methods yourself. In my opinion, the best way to handle this is by parsing the list into a delimited string, such as:

self.author_name = ', '.join(data['creator'])

If this works for you, I've implemented it in my fork. I plan on eventually submitting a pull request with the fixes from there.

from pysaucenao.

thesadru avatar thesadru commented on June 12, 2024

The problem is with the manga source specifically. author_name gets set again but this time without any validation.

from pysaucenao.

Myned avatar Myned commented on June 12, 2024

Understood, I can see that now. I can copy the same fix from GenericSource (parsing the list as a comma-delimited string), if that works for you.

from pysaucenao.

thesadru avatar thesadru commented on June 12, 2024

Yeah, that's fine. I was just surprised by it being a list since the annotation said it would always be an optional str.

from pysaucenao.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.