Repository: pymedusa/Medusa

Issue:
Duplicate settings for newznab providers
See screenshot: https://imgur.com/a/rEDbD

This a fresh install as of yesterday. Settings seem un-editable although the raw config.ini seems to be fine. Most sources have double or triple duplicates of the individual settings yet none of the check boxes actually do anything.

Also, related, none of my Jackett providers work in the manual search functionality even though they seem to be configured properly and the config.ini shows them as enabled and for daily and backlog both.

Ideas?



Discussion:
Try removing your mako cache?
Cache db?
On Tue, Oct 31, 2017 at 8:50 PM p0ps <notifications@github.com> wrote:

> Try removing your mako cache?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/pymedusa/Medusa/issues/3207#issuecomment-340902471>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AASBwafotbzuGqaEe9bThb5xtTkSmPQwks5sx4f4gaJpZM4QNT2K>
> .
>

No in your data folder, there is a cache folder. In there you'll find a folder named mako. Delete that. 
@p0psicles I don't see a data folder or any folder named mako. when i'm in the main Medusa top level directory and run ``` find -d . | grep mako ``` here's what I get

```
./ext/dogpile/cache/plugins/mako_cache.py
./ext/mako
./ext/mako/__init__.py
./ext/mako/__init__.pyc
./ext/mako/_ast_util.py
./ext/mako/_ast_util.pyc
./ext/mako/ast.py
./ext/mako/ast.pyc
./ext/mako/cache.py
./ext/mako/cache.pyc
./ext/mako/cmd.py
./ext/mako/codegen.py
./ext/mako/codegen.pyc
./ext/mako/compat.py
./ext/mako/compat.pyc
./ext/mako/exceptions.py
./ext/mako/exceptions.pyc
./ext/mako/ext
./ext/mako/ext/__init__.py
./ext/mako/ext/__init__.pyc
./ext/mako/ext/autohandler.py
./ext/mako/ext/babelplugin.py
./ext/mako/ext/beaker_cache.py
./ext/mako/ext/extract.py
./ext/mako/ext/linguaplugin.py
./ext/mako/ext/preprocessors.py
./ext/mako/ext/pygmentplugin.py
./ext/mako/ext/pygmentplugin.pyc
./ext/mako/ext/turbogears.py
./ext/mako/filters.py
./ext/mako/filters.pyc
./ext/mako/lexer.py
./ext/mako/lexer.pyc
./ext/mako/lookup.py
./ext/mako/lookup.pyc
./ext/mako/parsetree.py
./ext/mako/parsetree.pyc
./ext/mako/pygen.py
./ext/mako/pygen.pyc
./ext/mako/pyparser.py
./ext/mako/pyparser.pyc
./ext/mako/runtime.py
./ext/mako/runtime.pyc
./ext/mako/template.py
./ext/mako/template.pyc
./ext/mako/util.py
./ext/mako/util.pyc
./ext/pytz/zoneinfo/Africa/Bamako
./views/404.mako
./views/500.mako
./views/addRecommended.mako
./views/addShows.mako
./views/addShows_addExistingShow.mako
./views/addShows_newShow.mako
./views/addShows_recommended.mako
./views/addShows_trendingShows.mako
./views/apiBuilder.mako
./views/config.mako
./views/config_anime.mako
./views/config_backuprestore.mako
./views/config_general.mako
./views/config_notifications.mako
./views/config_postProcessing.mako
./views/config_providers.mako
./views/config_search.mako
./views/config_subtitles.mako
./views/displayShow.mako
./views/editShow.mako
./views/errorlogs.mako
./views/genericMessage.mako
./views/history.mako
./views/home.mako
./views/home_massAddTable.mako
./views/home_postprocess.mako
./views/inc_addShowOptions.mako
./views/inc_blackwhitelist.mako
./views/inc_defs.mako
./views/inc_qualityChooser.mako
./views/inc_rootDirs.mako
./views/index.mako
./views/IRC.mako
./views/layouts/main.mako
./views/login.mako
./views/manage.mako
./views/manage_backlogOverview.mako
./views/manage_episodeStatuses.mako
./views/manage_failedDownloads.mako
./views/manage_manageSearches.mako
./views/manage_massEdit.mako
./views/manage_subtitleMissed.mako
./views/manage_subtitleMissedPP.mako
./views/markdown.mako
./views/partials/alerts.mako
./views/partials/footer.mako
./views/partials/header.mako
./views/partials/home/banner.mako
./views/partials/home/poster.mako
./views/partials/home/simple.mako
./views/partials/home/small.mako
./views/partials/seasonEpisode.mako
./views/partials/showheader.mako
./views/partials/showSelector.mako
./views/partials/submenu.mako
./views/restart.mako
./views/schedule.mako
./views/snatchSelection.mako
./views/status.mako
./views/subtitle_modal.mako
./views/testRename.mako
./views/trendingShows.mako
./views/viewlogs.mako
```
It's in your data folder. Meaning your can have that directory separated from your medusa install.
It's the same folder as where your config.ini is located.
MAybe I'm crazy, but I did the find from my main Medusa folder. Everything
installed there, locally. ~/Medusa/cache/mako does not exist. Just 3 things
in there - images/ and two dbm files, both of which I've tried deleting.

On Wed, Nov 1, 2017 at 9:18 AM p0ps <notifications@github.com> wrote:

> It's in your data folder. Meaning your can have that directory separated
> from your medusa install.
> It's the same folder as where your config.ini is located.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/pymedusa/Medusa/issues/3207#issuecomment-341048211>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AASBwWR5do4Gd5sZrJakm-wFDZiVuedLks5syDdygaJpZM4QNT2K>
> .
>

That's strange indeed. No issues there regarding disk space, access/write rights?
Else jump on irc.
I've tried a few installs - the Docker version leaves a files in cache/mako but neither my normal nor my normal backup have a mako folder under cache from my top level directory. This is OSX btw.
 
I suggest to get on IRC. There we can help you better.
Sure - freenode?

On Wed, Nov 1, 2017 at 10:24 AM p0ps <notifications@github.com> wrote:

> I suggest to get on IRC. There we can help you better.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/pymedusa/Medusa/issues/3207#issuecomment-341065667>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AASBwTHi2IfmA6ESaY5p7UVM7QMGH5XGks5syEbdgaJpZM4QNT2K>
> .
>

Thanks to the guys on IRC today. I gave up and started with no config file and just rebuilt everything fresh from scratch once again and it seems to hold now and be working fine. I also moved it all to docker which hopefully will reduce points of failure in the future.
Cheers
Argh, so the errors are back again. Totally fresh everything and dockerized. I feel like I'm on crazy pills.
It's got to be some combination of having multiple custom NZB providers I suppose.
FWIW it seems to be happening only on the embedded NZB providers Usenet and Dognzb specifically. My other issue with Jackett returning no files is probably unrelated to this particular UI issue as the config seems to be working as expected in the backend from what I can tell.
https://imgur.com/a/fBaSl

Resolving patch:
diff --git a/medusa/providers/nzb/newznab.py b/medusa/providers/nzb/newznab.py
--- a/medusa/providers/nzb/newznab.py
+++ b/medusa/providers/nzb/newznab.py
@@ -327,7 +327,7 @@ def get_newznab_providers(providers):
     @staticmethod
     def save_newnab_providers():
         """Update the app.NEWZNAB_PROVIDERS list with provider names."""
-        app.NEWZNAB_PROVIDERS = [provider.name.upper() for provider in app.newznabProviderList if not provider.default]
+        app.NEWZNAB_PROVIDERS = [provider.name for provider in app.newznabProviderList if not provider.default]
 
     @staticmethod
     def get_providers_list(provider_data):
diff --git a/medusa/server/web/config/providers.py b/medusa/server/web/config/providers.py
--- a/medusa/server/web/config/providers.py
+++ b/medusa/server/web/config/providers.py
@@ -274,8 +274,8 @@ def saveProviders(self, newznab_string='', torrentrss_string='', provider_order=
             if cur_provider.get_id() not in finished_names:
                 app.newznabProviderList.remove(cur_provider)
 
-        # Update the newznab provider list
-        app.NEWZNAB_PROVIDERS = [provider.name.upper() for provider in app.newznabProviderList]
+        # Update the custom newznab provider list
+        NewznabProvider.save_newnab_providers()
 
         torrent_rss_provider_dict = dict(
             zip([x.get_id() for x in app.torrentRssProviderList], app.torrentRssProviderList))
@@ -310,7 +310,8 @@ def saveProviders(self, newznab_string='', torrentrss_string='', provider_order=
             if cur_provider.get_id() not in finished_names:
                 app.torrentRssProviderList.remove(cur_provider)
 
-        app.TORRENTRSS_PROVIDERS = [provider.name.upper() for provider in app.torrentRssProviderList]
+        # Update the torrentrss provider list
+        app.TORRENTRSS_PROVIDERS = [provider.name for provider in app.torrentRssProviderList]
 
         disabled_list = []
         # do the enable/disable


Test patch: