Skip to content

Commit

Permalink
move tag ids into constants file
Browse files Browse the repository at this point in the history
  • Loading branch information
yedpodtrzitko committed Jun 16, 2024
1 parent f28df4f commit 572f242
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions tagstudio/src/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,6 @@
"cool gray",
"olive",
]

TAG_FAVORITE = 1
TAG_ARCHIVED = 0
3 changes: 0 additions & 3 deletions tagstudio/src/core/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""The Library object and related methods for TagStudio."""

import datetime
import json
import logging
import os
import time
Expand All @@ -18,8 +17,6 @@
from typing import cast, Generator
from typing_extensions import Self

import ujson

from src.core.enums import FieldID
from src.core.json_typing import JsonCollation, JsonEntry, JsonLibary, JsonTag
from src.core.utils.str import strip_punctuation
Expand Down
2 changes: 2 additions & 0 deletions tagstudio/src/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
TS_FOLDER_NAME,
VERSION_BRANCH,
VERSION,
TAG_FAVORITE,
TAG_ARCHIVED,
)
from src.core.utils.web import strip_web_protocol
from src.qt.flowlayout import FlowLayout
Expand Down
11 changes: 7 additions & 4 deletions tagstudio/src/qt/widgets/item_thumb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import os
import time
import typing
from types import FunctionType
from pathlib import Path
from typing import Optional

Expand All @@ -25,7 +24,13 @@

from src.core.enums import FieldID
from src.core.library import ItemType, Library, Entry
from src.core.constants import AUDIO_TYPES, VIDEO_TYPES, IMAGE_TYPES
from src.core.constants import (
AUDIO_TYPES,
VIDEO_TYPES,
IMAGE_TYPES,
TAG_FAVORITE,
TAG_ARCHIVED,
)
from src.qt.flowlayout import FlowWidget
from src.qt.helpers.file_opener import FileOpenerHelper
from src.qt.widgets.thumb_renderer import ThumbRenderer
Expand All @@ -38,8 +43,6 @@
WARNING = f"[WARNING]"
INFO = f"[INFO]"

TAG_FAVORITE = 1
TAG_ARCHIVED = 0

logging.basicConfig(format="%(message)s", level=logging.INFO)

Expand Down
1 change: 1 addition & 0 deletions tagstudio/src/qt/widgets/tag_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from PySide6.QtCore import Signal, Qt
from PySide6.QtWidgets import QPushButton

from src.core.constants import TAG_FAVORITE, TAG_ARCHIVED
from src.core.library import Library, Tag
from src.qt.flowlayout import FlowLayout
from src.qt.widgets.fields import FieldWidget
Expand Down

0 comments on commit 572f242

Please sign in to comment.