Miscellaneous Subliminal plugin improvements#1304
Conversation
ee280fa to
7bb65b6
Compare
|
Fixed Codacy issue. |
|
Do all providers need/have relevant config options? |
Currently only those that need authentication.
I commented about that in the commit: using only the subliminal:
providers:
legendastv:
username: myuser
password: mypassword
opensubtitles: yesIt would still not cover the case of omitting subliminal:
providers:
all: yes
legendastv:
username: myuser
password: mypasswordWhich would pass a |
|
Couldn't you just do this: subliminal:
providers:
legendastv:
username: myuser
password: mypassword |
|
@cvium I just edited my comment above to explain why not. |
|
You could set type to be object or string, then check in code : |
|
@liiight I don't think there is any specification that the configs will always be for authentication - it just happens to be the current situation. Using only the |
The above will let you do this: subliminal:
providers:
- legendastv:
username: myuser
password: mypassword
- opensubtitles |
|
@cvium That looks really nice. But what about the option of enabling all available providers? edit: Would an |
|
I think I prefer having |
|
What about this: providers:
all: yes
configs:
legendastv:
username: myuser
password: mypasswordFor the case of keeping all providers and configuring some. @cvium's last suggestion would also work. |
|
Nay for |
|
Perhaps call the key |
|
Any progress on this? |
7bb65b6 to
e57beea
Compare
Some subtitle providers require authentication. To configure them, subliminal accepts the `provider_configs` option to the ProviderPool class. Add support for it through an `authentication` configuration key. Having the provider configurations be specified in the `providers` key would look nicer, but break the case where one wants to authenticate to specific providers, but still use all the available ones (by leaving out the `providers` option completely).
Dogpile can spam log messages such as the following at the debug level. Silence it. 2016-07-31 00:44 DEBUG dogpile.util.readwrite_lock subs <dogpile.util.readwrite_lock.ReadWriteMutex object at 0x7f693c4c08d0> acquired read lock
e57beea to
6104823
Compare
|
I've renamed the configuration key from |
| try: | ||
| from subliminal.extensions import provider_manager | ||
| PROVIDERS = provider_manager.names() | ||
| except ImportError as e: |
There was a problem hiding this comment.
Since you don't use the exception it's better not to include as e.
There was a problem hiding this comment.
It was a leftover from debugging. Nice catch, thanks!
|
Other than some PEP8 issues it looks fine. |
|
Would it be preferable to fix the issues in an extra commit or just amend the previous ones? |
|
Another commit is fine |
|
Done. |
|
I don't know what's wrong with Codacy, it shows no issues with the commit but fails anyway. |
|
We had miscommunication so our codacy account got deleted along with its config. We have yet to reconfigure the new one. |
|
I update the Wiki page with the new additions. Thanks a lot! |
Motivation/Detailed changes:
provider_configsoption.hearing_impairedoption.Config usage if relevant (new plugin or updated schema):
Add
provider_configsoptionAdd
hearing_impairedoption