Comments (5)
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.
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.
The problem is with the manga source specifically. author_name
gets set again but this time without any validation.
from pysaucenao.
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.
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)
- Unknown status code: 4 HOT 1
- Anime sources should be prioritized when meeting a minimum similarity threshold HOT 4
- SyntaxError: 'await' outside function HOT 1
- What about proxy support? HOT 2
- ValueError: time data '2017-04-21T05:16:51.000Z' does not match format '%Y-%m-%dT%H:%M:%SZ' HOT 4
- Make pysaucenao type-complete
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysaucenao.