Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fix notify list #8535

Merged
merged 10 commits into from
Sep 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#### Improvements

#### Fixes
- Fix notify lists for prowl and email ([8535](https://github.com/pymedusa/Medusa/pull/8535))
- Fix shows sorting by article sort using (the, a, an) was reversed in config-general ([8532](https://github.com/pymedusa/Medusa/pull/8532))
- Fix sending torrents to qBittorrent api version > 2.0.0 ([8528](https://github.com/pymedusa/Medusa/pull/8528))

-----

Expand Down
16 changes: 9 additions & 7 deletions medusa/server/web/home/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,23 +515,25 @@ def loadShowNotifyLists():

@staticmethod
def saveShowNotifyList(show=None, emails=None, prowlAPIs=None):
entries = {'emails': '', 'prowlAPIs': ''}

series_identifier = SeriesIdentifier.from_slug(show)
series_obj = Series.find_by_identifier(series_identifier)

if series_obj:
if series_obj.notify_list:
entries = series_obj.notify_list
# Create a new dict, to force the "dirty" flag on the Series object.
entries = {'emails': '', 'prowlAPIs': ''}

if not series_obj:
return 'show missing'

if series_obj.notify_list:
entries.update(series_obj.notify_list)

if emails is not None:
entries['emails'] = emails
series_obj.notify_list = entries

if prowlAPIs is not None:
entries['prowlAPIs'] = prowlAPIs
series_obj.notify_list = entries

series_obj.notify_list = entries
series_obj.save_to_db()

return 'OK'
Expand Down
2 changes: 2 additions & 0 deletions medusa/tv/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import copy
import datetime
import glob
import json
import logging
import os.path
import shutil
Expand Down Expand Up @@ -2026,6 +2027,7 @@ def save_to_db(self):
'scene': self.scene,
'sports': self.sports,
'subtitles': self.subtitles,
'notify_list': json.dumps(self.notify_list),
'dvdorder': self.dvd_order,
'startyear': self.start_year,
'lang': self.lang,
Expand Down
4 changes: 2 additions & 2 deletions themes-default/slim/src/components/helpers/select-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<ul v-if="!csvMode">
<li v-for="item of editItems" :key="item.id">
<div class="input-group">
<input class="form-control input-sm" type="text" v-model="item.value" @input="removeEmpty(item)">
<input disabled class="form-control input-sm" type="text" v-model="item.value" @input="removeEmpty(item)">
<div class="input-group-btn" @click="deleteItem(item)">
<div style="font-size: 14px" class="btn btn-default input-sm">
<div style="font-size: 14px; background-color: rgb(238, 238, 238);" class="btn btn-default input-sm">
<i class="glyphicon glyphicon-remove" title="Remove" />
</div>
</div>
Expand Down
6 changes: 1 addition & 5 deletions themes-default/slim/src/components/helpers/show-selector.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div v-if="showForRoutes" class="show-selector form-inline hidden-print">
<div class="show-selector form-inline hidden-print">
<div class="select-show-group pull-left top-5 bottom-5">
<select v-if="shows.length === 0" :class="selectClass" disabled>
<option>Loading...</option>
Expand Down Expand Up @@ -76,10 +76,6 @@ export default {
});

return sortedShows;
},
showForRoutes() {
const { $route } = this;
return ['show', 'editShow'].includes($route.name);
}
},
watch: {
Expand Down
6 changes: 5 additions & 1 deletion themes-default/slim/src/components/sub-menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<span :class="['pull-left', menuItem.icon]" /> {{ menuItem.title }}
</app-link>

<show-selector :show-slug="curShowSlug" follow-selection />
<show-selector v-if="showForRoutes" :show-slug="curShowSlug" follow-selection />
</div>
</div>

Expand Down Expand Up @@ -47,6 +47,10 @@ export default {
return indexername + seriesid;
}
return '';
},
showForRoutes() {
const { $route } = this;
return ['show', 'editShow'].includes($route.name);
}
},
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ exports[`SelectList.test.js renders with values 1`] = `
>
<input
class="form-control input-sm"
disabled="disabled"
type="text"
/>

Expand All @@ -68,7 +69,7 @@ exports[`SelectList.test.js renders with values 1`] = `
>
<div
class="btn btn-default input-sm"
style="font-size: 14px;"
style="font-size: 14px; background-color: rgb(238, 238, 238);"
>
<i
class="glyphicon glyphicon-remove"
Expand All @@ -84,6 +85,7 @@ exports[`SelectList.test.js renders with values 1`] = `
>
<input
class="form-control input-sm"
disabled="disabled"
type="text"
/>

Expand All @@ -92,7 +94,7 @@ exports[`SelectList.test.js renders with values 1`] = `
>
<div
class="btn btn-default input-sm"
style="font-size: 14px;"
style="font-size: 14px; background-color: rgb(238, 238, 238);"
>
<i
class="glyphicon glyphicon-remove"
Expand All @@ -108,6 +110,7 @@ exports[`SelectList.test.js renders with values 1`] = `
>
<input
class="form-control input-sm"
disabled="disabled"
type="text"
/>

Expand All @@ -116,7 +119,7 @@ exports[`SelectList.test.js renders with values 1`] = `
>
<div
class="btn btn-default input-sm"
style="font-size: 14px;"
style="font-size: 14px; background-color: rgb(238, 238, 238);"
>
<i
class="glyphicon glyphicon-remove"
Expand Down
12 changes: 2 additions & 10 deletions themes-default/slim/test/specs/__snapshots__/sub-menu.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ exports[`SubMenu.test.js renders function-based sub menu 1`] = `

</app-link-stub>

<show-selector-stub
followselection="true"
selectclass="select-show form-control input-sm-custom"
showslug=""
/>
<!---->
</div>
</div>

Expand Down Expand Up @@ -75,11 +71,7 @@ exports[`SubMenu.test.js renders simple sub menu 1`] = `

</app-link-stub>

<show-selector-stub
followselection="true"
selectclass="select-show form-control input-sm-custom"
showslug=""
/>
<!---->
</div>
</div>

Expand Down
Loading