clean: rename bulk_album category

This commit is contained in:
2025-07-07 23:03:48 +02:00
parent a980dd8ead
commit 67a83708cf
7 changed files with 49 additions and 49 deletions

View File

@ -11,7 +11,7 @@ import config
if TYPE_CHECKING:
from bulk_page import BulkPage
from bulk_album import Album
from bulk_category import BulkCategory
class Picture():
def __init__(self, picture_path: Path, id: int, page: BulkPage = None, raw: Path|None = None, is_repertoried: bool = True):
@ -19,21 +19,21 @@ class Picture():
self._small: Path = Path(picture_path.get_absolute_path()[:-4] + "_small.jpg")
self._thumb: Path = Path(picture_path.get_absolute_path()[:-4] + "_thumb.jpg")
self._profile_file: Path = Path(picture_path.get_absolute_path() + ".out.pp3")
self._albums_file: Path = Path(picture_path.get_absolute_path()[:-4] + "_albums.txt")
self._categories_file: Path = Path(picture_path.get_absolute_path()[:-4] + "_categories.txt")
self._raw: Path|None = raw
self.id: int = id
self._page: BulkPage = page
self._albums_name: list[str] = []
self.albums: list[Album] = []
if self._albums_file.exist():
with open(self._albums_file.get_absolute_path(), "r+") as f:
albums_name: list[str] = f.read()
if (len(albums_name)):
self._albums_name += albums_name.split("\n")
self._categories_name: list[str] = []
self.categories: list[BulkCategory] = []
if self._categories_file.exist():
with open(self._categories_file.get_absolute_path(), "r+") as f:
categories_name: list[str] = f.read()
if (len(categories_name)):
self._categories_name += categories_name.split("\n")
else:
self._albums_file.touch()
if (config.CREATE_GENERAL_ALBUM):
self._albums_name.append("general")
self._categories_file.touch()
if (config.CREATE_GENERAL_CATEGORY):
self._categories_name.append("general")
self._is_reperoried: bool = is_repertoried
self.get_small()
self.get_thumb()
@ -41,8 +41,8 @@ class Picture():
def get_page(self):
return self._page
def get_albums_name(self):
return self._albums_name
def get_categories_name(self):
return self._categories_name
def get_small(self):
if not self._small.exist():