🤬
  • Watch list & notification - Adding extra list batch operations for Mute, Unmute, Reset-to-default

  • Loading...
  • dgtlmoon committed 2 years ago
    26e2f21a
    1 parent b6009ae9
  • ■ ■ ■ ■ ■ ■
    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
  • ■ ■ ■ ■ ■ ■
    changedetectionio/templates/watch-overview.html
    skipped 29 lines
    30 30   <div id="checkbox-operations">
    31 31   <button class="pure-button button-secondary button-xsmall" style="font-size: 70%" name="op" value="pause">Pause</button>
    32 32   <button class="pure-button button-secondary button-xsmall" style="font-size: 70%" name="op" value="unpause">UnPause</button>
     33 + <button class="pure-button button-secondary button-xsmall" style="font-size: 70%" name="op" value="mute">Mute</button>
     34 + <button class="pure-button button-secondary button-xsmall" style="font-size: 70%" name="op" value="unmute">UnMute</button>
     35 + <button class="pure-button button-secondary button-xsmall" style="font-size: 70%" name="op" value="notification-default">Use default notification</button>
    33 36   <button class="pure-button button-secondary button-xsmall" style="background: #dd4242; font-size: 70%" name="op" value="delete">Delete</button>
    34 37   </div>
    35 38   <div>
    skipped 112 lines
Please wait...
Page is in error, reload to recover