mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-02-01 23:59:10 +00:00
add more constraint types
This commit is contained in:
@@ -4,13 +4,20 @@ from typing import Union
|
||||
|
||||
class ConstraintType(Enum): # TODO add remaining ones
|
||||
Tag = 0
|
||||
MediaType = 1
|
||||
TagID = 1
|
||||
MediaType = 2
|
||||
FileType = 3
|
||||
Path = 4
|
||||
|
||||
@staticmethod
|
||||
def from_string(text: str) -> "ConstraintType":
|
||||
return {"tag": ConstraintType.Tag, "mediatype": ConstraintType.MediaType}.get(
|
||||
text.lower(), None
|
||||
)
|
||||
return {
|
||||
"tag": ConstraintType.Tag,
|
||||
"tag_id": ConstraintType.TagID,
|
||||
"mediatype": ConstraintType.MediaType,
|
||||
"filetype": ConstraintType.FileType,
|
||||
"path": ConstraintType.Path,
|
||||
}.get(text.lower(), None)
|
||||
|
||||
|
||||
class AST:
|
||||
|
||||
Reference in New Issue
Block a user