Skip to content

Commit 8f17c36

Browse files
committed
Compare
1 parent 6f4f96d commit 8f17c36

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

tagstudio/src/core/library/alchemy/library.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ def migrate_json_to_sqlite(self, json_lib: JsonLibrary):
222222
for child_id in tag.subtag_ids:
223223
self.add_parent_tag(parent_id=tag.id, child_id=child_id)
224224

225+
226+
print("\n\n\n\nHERE\n\n\n\n\n")
225227
# Entries
226228
self.add_entries(
227229
[
@@ -231,6 +233,8 @@ def migrate_json_to_sqlite(self, json_lib: JsonLibrary):
231233
fields=[],
232234
id=entry.id + 1, # JSON IDs start at 0 instead of 1
233235
date_added=datetime.now(),
236+
date_modified=datetime.now(),
237+
date_created=datetime.now(),
234238
)
235239
for entry in json_lib.entries
236240
]
@@ -287,7 +291,7 @@ def open_sqlite_library(self, library_dir: Path, is_new: bool) -> LibraryStatus:
287291
drivername="sqlite",
288292
database=str(self.storage_path),
289293
)
290-
# NOTE: File-based databases should use NullPool to create new DB connection in order to
294+
# NOTE: File-based databases should use NullPool ito create new DB connection in order to
291295
# keep connections on separate threads, which prevents the DB files from being locked
292296
# even after a connection has been closed.
293297
# SingletonThreadPool (the default for :memory:) should still be used for in-memory DBs.

tagstudio/src/core/library/alchemy/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ class ValueType(Base):
272272
is_default: Mapped[bool]
273273
position: Mapped[int]
274274

275-
# add relations to other tables
275+
# add relations to otheu tables
276276
text_fields: Mapped[list[TextField]] = relationship("TextField", back_populates="type")
277277
datetime_fields: Mapped[list[DatetimeField]] = relationship(
278278
"DatetimeField", back_populates="type"

tagstudio/src/core/utils/refresh_dir.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def save_new_files(self):
6666
folder=self.library.folder,
6767
fields=[],
6868
date_added=dt.now(),
69-
date_created=date_created,
70-
date_modified=date_modified,
69+
date_created=dt.now(),
70+
date_modified=dt.now(),
7171
)
7272
)
7373
self.library.add_entries(entries)

0 commit comments

Comments
 (0)