Skip to content

Commit 3df5169

Browse files
committed
add method with_mod_time()
1 parent d0b5a07 commit 3df5169

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

kitsunekko_tools/api_access/directory_entry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
KitsuDirectoryMeta,
1010
get_meta_file_path,
1111
)
12-
from kitsunekko_tools.common import max_datetime
12+
from kitsunekko_tools.common import datetime_now_utc, max_datetime
1313
from kitsunekko_tools.config import KitsuConfig
1414

1515

kitsunekko_tools/api_access/root_directory.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ def write_to_file(self, fp: typing.TextIO) -> None:
101101
ensure_ascii=False,
102102
)
103103

104+
def with_mod_time(self, mod_time: datetime.datetime) -> typing.Self:
105+
return dataclasses.replace(self, last_modified=mod_time)
106+
104107

105108
@dataclasses.dataclass(frozen=True)
106109
class KitsuDirectoryMeta(ApiDirectoryEntry):

0 commit comments

Comments
 (0)