■ ■ ■ ■ ■ ■ ■
changedetectionio/__init__.py
| skipped 1188 lines |
1189 | 1189 | | datastore.delete(uuid.strip()) |
1190 | 1190 | | flash("{} watches deleted".format(len(uuids))) |
1191 | 1191 | | |
1192 | | - | if (op == 'pause'): |
| 1192 | + | elif (op == 'pause'): |
1193 | 1193 | | for uuid in uuids: |
1194 | 1194 | | uuid = uuid.strip() |
1195 | 1195 | | if datastore.data['watching'].get(uuid): |
| skipped 1 lines |
1197 | 1197 | | |
1198 | 1198 | | flash("{} watches paused".format(len(uuids))) |
1199 | 1199 | | |
1200 | | - | if (op == 'unpause'): |
| 1200 | + | elif (op == 'unpause'): |
1201 | 1201 | | for uuid in uuids: |
1202 | 1202 | | uuid = uuid.strip() |
1203 | 1203 | | if datastore.data['watching'].get(uuid): |
1204 | 1204 | | datastore.data['watching'][uuid.strip()]['paused'] = False |
1205 | 1205 | | flash("{} watches unpaused".format(len(uuids))) |
| 1206 | + | |
| 1207 | + | elif (op == 'mute'): |
| 1208 | + | for uuid in uuids: |
| 1209 | + | uuid = uuid.strip() |
| 1210 | + | if datastore.data['watching'].get(uuid): |
| 1211 | + | datastore.data['watching'][uuid.strip()]['notification_muted'] = True |
| 1212 | + | flash("{} watches muted".format(len(uuids))) |
| 1213 | + | |
| 1214 | + | elif (op == 'unmute'): |
| 1215 | + | for uuid in uuids: |
| 1216 | + | uuid = uuid.strip() |
| 1217 | + | if datastore.data['watching'].get(uuid): |
| 1218 | + | datastore.data['watching'][uuid.strip()]['notification_muted'] = False |
| 1219 | + | flash("{} watches un-muted".format(len(uuids))) |
| 1220 | + | |
| 1221 | + | elif (op == 'notification-default'): |
| 1222 | + | from changedetectionio.notification import ( |
| 1223 | + | default_notification_format_for_watch |
| 1224 | + | ) |
| 1225 | + | for uuid in uuids: |
| 1226 | + | uuid = uuid.strip() |
| 1227 | + | if datastore.data['watching'].get(uuid): |
| 1228 | + | datastore.data['watching'][uuid.strip()]['notification_title'] = None |
| 1229 | + | datastore.data['watching'][uuid.strip()]['notification_body'] = None |
| 1230 | + | datastore.data['watching'][uuid.strip()]['notification_urls'] = [] |
| 1231 | + | datastore.data['watching'][uuid.strip()]['notification_format'] = default_notification_format_for_watch |
| 1232 | + | flash("{} watches set to use default notification settings".format(len(uuids))) |
1206 | 1233 | | |
1207 | 1234 | | return redirect(url_for('index')) |
1208 | 1235 | | |
| skipped 221 lines |