mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-08-29 01:27:30 +00:00
Build and push containers / metadata (push) Waiting to run
Build and push containers / build-push-containers (push) Waiting to run
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Build distribution 📦 (push) Waiting to run
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Test the built 📦 package works basically. (push) Blocked by required conditions
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Publish Python 🐍 distribution 📦 to PyPI (push) Blocked by required conditions
ChangeDetection.io App Test / lint-code (push) Waiting to run
ChangeDetection.io App Test / test-application-3-10 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-11 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-12 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-13 (push) Blocked by required conditions
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
|
|
from changedetectionio.strtobool import strtobool
|
|
from flask import Blueprint, flash, redirect, url_for
|
|
from flask_login import login_required
|
|
from changedetectionio.store import ChangeDetectionStore
|
|
from changedetectionio import queuedWatchMetaData
|
|
from queue import PriorityQueue
|
|
|
|
PRICE_DATA_TRACK_ACCEPT = 'accepted'
|
|
PRICE_DATA_TRACK_REJECT = 'rejected'
|
|
|
|
def construct_blueprint(datastore: ChangeDetectionStore, update_q: PriorityQueue):
|
|
|
|
price_data_follower_blueprint = Blueprint('price_data_follower', __name__)
|
|
|
|
@login_required
|
|
@price_data_follower_blueprint.route("/<string:uuid>/accept", methods=['GET'])
|
|
def accept(uuid):
|
|
datastore.data['watching'][uuid]['track_ldjson_price_data'] = PRICE_DATA_TRACK_ACCEPT
|
|
datastore.data['watching'][uuid]['processor'] = 'restock_diff'
|
|
datastore.data['watching'][uuid].clear_watch()
|
|
update_q.put(queuedWatchMetaData.PrioritizedItem(priority=1, item={'uuid': uuid}))
|
|
return redirect(url_for("watchlist.index"))
|
|
|
|
@login_required
|
|
@price_data_follower_blueprint.route("/<string:uuid>/reject", methods=['GET'])
|
|
def reject(uuid):
|
|
datastore.data['watching'][uuid]['track_ldjson_price_data'] = PRICE_DATA_TRACK_REJECT
|
|
return redirect(url_for("watchlist.index"))
|
|
|
|
|
|
return price_data_follower_blueprint
|
|
|
|
|