Skip to content

Commit 41f53a7

Browse files
p0psiclesmedariox
andauthored
Feature/fix notify list (#8535)
* Write notify_list to db. * make sure show-lists component is visiable in config-notification.vue. * Create a @Property for changing notify_list. * Don't need property now. * disable textbox items in select-list.vue. * This will not give users the misunderstanding that the fields can be changed. As they need to be removed/added. * Update changelog * Update bundles * Fix jest tests * Bundle after upmerge * yarn dev Co-authored-by: Dario <medariox@users.noreply.github.com>
1 parent e5775b7 commit 41f53a7

File tree

10 files changed

+42
-40
lines changed

10 files changed

+42
-40
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#### Improvements
66

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

912
-----
1013

medusa/server/web/home/handler.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -515,23 +515,25 @@ def loadShowNotifyLists():
515515

516516
@staticmethod
517517
def saveShowNotifyList(show=None, emails=None, prowlAPIs=None):
518-
entries = {'emails': '', 'prowlAPIs': ''}
519-
520518
series_identifier = SeriesIdentifier.from_slug(show)
521519
series_obj = Series.find_by_identifier(series_identifier)
522520

523-
if series_obj:
524-
if series_obj.notify_list:
525-
entries = series_obj.notify_list
521+
# Create a new dict, to force the "dirty" flag on the Series object.
522+
entries = {'emails': '', 'prowlAPIs': ''}
523+
524+
if not series_obj:
525+
return 'show missing'
526+
527+
if series_obj.notify_list:
528+
entries.update(series_obj.notify_list)
526529

527530
if emails is not None:
528531
entries['emails'] = emails
529-
series_obj.notify_list = entries
530532

531533
if prowlAPIs is not None:
532534
entries['prowlAPIs'] = prowlAPIs
533-
series_obj.notify_list = entries
534535

536+
series_obj.notify_list = entries
535537
series_obj.save_to_db()
536538

537539
return 'OK'

medusa/tv/series.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import copy
88
import datetime
99
import glob
10+
import json
1011
import logging
1112
import os.path
1213
import shutil
@@ -2026,6 +2027,7 @@ def save_to_db(self):
20262027
'scene': self.scene,
20272028
'sports': self.sports,
20282029
'subtitles': self.subtitles,
2030+
'notify_list': json.dumps(self.notify_list),
20292031
'dvdorder': self.dvd_order,
20302032
'startyear': self.start_year,
20312033
'lang': self.lang,

themes-default/slim/src/components/helpers/select-list.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<ul v-if="!csvMode">
66
<li v-for="item of editItems" :key="item.id">
77
<div class="input-group">
8-
<input class="form-control input-sm" type="text" v-model="item.value" @input="removeEmpty(item)">
8+
<input disabled class="form-control input-sm" type="text" v-model="item.value" @input="removeEmpty(item)">
99
<div class="input-group-btn" @click="deleteItem(item)">
10-
<div style="font-size: 14px" class="btn btn-default input-sm">
10+
<div style="font-size: 14px; background-color: rgb(238, 238, 238);" class="btn btn-default input-sm">
1111
<i class="glyphicon glyphicon-remove" title="Remove" />
1212
</div>
1313
</div>

themes-default/slim/src/components/helpers/show-selector.vue

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div v-if="showForRoutes" class="show-selector form-inline hidden-print">
2+
<div class="show-selector form-inline hidden-print">
33
<div class="select-show-group pull-left top-5 bottom-5">
44
<select v-if="shows.length === 0" :class="selectClass" disabled>
55
<option>Loading...</option>
@@ -76,10 +76,6 @@ export default {
7676
});
7777
7878
return sortedShows;
79-
},
80-
showForRoutes() {
81-
const { $route } = this;
82-
return ['show', 'editShow'].includes($route.name);
8379
}
8480
},
8581
watch: {

themes-default/slim/src/components/sub-menu.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<span :class="['pull-left', menuItem.icon]" /> {{ menuItem.title }}
1313
</app-link>
1414

15-
<show-selector :show-slug="curShowSlug" follow-selection />
15+
<show-selector v-if="showForRoutes" :show-slug="curShowSlug" follow-selection />
1616
</div>
1717
</div>
1818

@@ -47,6 +47,10 @@ export default {
4747
return indexername + seriesid;
4848
}
4949
return '';
50+
},
51+
showForRoutes() {
52+
const { $route } = this;
53+
return ['show', 'editShow'].includes($route.name);
5054
}
5155
},
5256
methods: {

themes-default/slim/test/specs/__snapshots__/select-list.spec.js.snap

+6-3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ exports[`SelectList.test.js renders with values 1`] = `
6060
>
6161
<input
6262
class="form-control input-sm"
63+
disabled="disabled"
6364
type="text"
6465
/>
6566
@@ -68,7 +69,7 @@ exports[`SelectList.test.js renders with values 1`] = `
6869
>
6970
<div
7071
class="btn btn-default input-sm"
71-
style="font-size: 14px;"
72+
style="font-size: 14px; background-color: rgb(238, 238, 238);"
7273
>
7374
<i
7475
class="glyphicon glyphicon-remove"
@@ -84,6 +85,7 @@ exports[`SelectList.test.js renders with values 1`] = `
8485
>
8586
<input
8687
class="form-control input-sm"
88+
disabled="disabled"
8789
type="text"
8890
/>
8991
@@ -92,7 +94,7 @@ exports[`SelectList.test.js renders with values 1`] = `
9294
>
9395
<div
9496
class="btn btn-default input-sm"
95-
style="font-size: 14px;"
97+
style="font-size: 14px; background-color: rgb(238, 238, 238);"
9698
>
9799
<i
98100
class="glyphicon glyphicon-remove"
@@ -108,6 +110,7 @@ exports[`SelectList.test.js renders with values 1`] = `
108110
>
109111
<input
110112
class="form-control input-sm"
113+
disabled="disabled"
111114
type="text"
112115
/>
113116
@@ -116,7 +119,7 @@ exports[`SelectList.test.js renders with values 1`] = `
116119
>
117120
<div
118121
class="btn btn-default input-sm"
119-
style="font-size: 14px;"
122+
style="font-size: 14px; background-color: rgb(238, 238, 238);"
120123
>
121124
<i
122125
class="glyphicon glyphicon-remove"

themes-default/slim/test/specs/__snapshots__/sub-menu.spec.js.snap

+2-10
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ exports[`SubMenu.test.js renders function-based sub menu 1`] = `
2525
2626
</app-link-stub>
2727
28-
<show-selector-stub
29-
followselection="true"
30-
selectclass="select-show form-control input-sm-custom"
31-
showslug=""
32-
/>
28+
<!---->
3329
</div>
3430
</div>
3531
@@ -75,11 +71,7 @@ exports[`SubMenu.test.js renders simple sub menu 1`] = `
7571
7672
</app-link-stub>
7773
78-
<show-selector-stub
79-
followselection="true"
80-
selectclass="select-show form-control input-sm-custom"
81-
showslug=""
82-
/>
74+
<!---->
8375
</div>
8476
</div>
8577

0 commit comments

Comments
 (0)