We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 666c412 commit 189fedbCopy full SHA for 189fedb
beetsplug/web/__init__.py
@@ -17,9 +17,10 @@
17
import base64
18
import json
19
import os
20
+import typing as t
21
22
import flask
-from flask import g, jsonify
23
+from flask import jsonify
24
from unidecode import unidecode
25
from werkzeug.routing import BaseConverter, PathConverter
26
@@ -28,6 +29,17 @@
28
29
from beets.dbcore.query import PathQuery
30
from beets.plugins import BeetsPlugin
31
32
+# Type checking hacks
33
+
34
+if t.TYPE_CHECKING:
35
36
+ class LibraryCtx(flask.ctx._AppCtxGlobals):
37
+ lib: beets.library.Library
38
39
+ g = LibraryCtx()
40
+else:
41
+ from flask import g
42
43
# Utilities.
44
45
0 commit comments