1313
1414from bs4 import BeautifulSoup
1515
16- from plugin .utils import (
17- calculate_time_difference ,
18- get_github_usernames_from_file ,
19- get_youtube_video_ids ,
20- )
16+ from plugin .utils import calculate_time_difference , get_youtube_video_ids
2117
2218today = datetime .now ()
2319DEFAULT_CREATION_DATE = (today - timedelta (days = 365 )).strftime ("%Y-%m-%d %H:%M:%S +0000" )
3026def get_git_info (
3127 file_path : str ,
3228 add_authors : bool = True ,
33- default_author : str | None = None ,
3429 git_data : dict [str , dict [str , Any ]] | None = None ,
35- repo_url : str | None = None ,
3630) -> dict [str , Any ]:
37- """Retrieve git information (dates + optional authors) from precomputed git data."""
31+ """Retrieve git information (dates + pre-resolved authors) from precomputed git data."""
3832 file_path = str (Path (file_path ).resolve ())
3933 git_info = {
4034 "creation_date" : DEFAULT_CREATION_DATE ,
@@ -45,29 +39,12 @@ def get_git_info(
4539 return git_info
4640
4741 cached = git_data [file_path ]
48- git_info .update (
49- {
50- "creation_date" : cached .get ("creation_date" , DEFAULT_CREATION_DATE ),
51- "last_modified_date" : cached .get ("last_modified_date" , DEFAULT_MODIFIED_DATE ),
52- }
53- )
54-
55- if add_authors and cached .get ("emails" ):
56- git_info ["authors" ] = sorted (
57- [
58- (
59- author ,
60- info ["url" ],
61- info ["changes" ],
62- info ["avatar" ],
63- )
64- for author , info in get_github_usernames_from_file (
65- file_path , default_user = default_author , emails = cached ["emails" ], repo_url = repo_url
66- ).items ()
67- ],
68- key = lambda x : x [2 ],
69- reverse = True ,
70- )
42+ git_info ["creation_date" ] = cached .get ("creation_date" , DEFAULT_CREATION_DATE )
43+ git_info ["last_modified_date" ] = cached .get ("last_modified_date" , DEFAULT_MODIFIED_DATE )
44+
45+ # Authors are pre-resolved by resolve_all_authors() in the main process
46+ if add_authors and "authors" in cached :
47+ git_info ["authors" ] = cached ["authors" ]
7148
7249 return git_info
7350
@@ -309,7 +286,6 @@ def process_html(
309286 git_data : dict [str , dict [str , Any ]] | None = None ,
310287 repo_url : str | None = None ,
311288 default_image : str | None = None ,
312- default_author : str | None = None ,
313289 keywords : str | None = None ,
314290 add_desc : bool = True ,
315291 add_image : bool = True ,
@@ -493,9 +469,7 @@ def process_html(
493469 needs_git = (add_authors or add_json_ld ) and src_path
494470
495471 if needs_git :
496- git_info = get_git_info (
497- src_path , add_authors = add_authors , default_author = default_author , git_data = git_data , repo_url = repo_url
498- )
472+ git_info = get_git_info (src_path , add_authors = add_authors , git_data = git_data )
499473
500474 # Only render git footer if we have real git history (not placeholder defaults)
501475 has_real_git_data = (
0 commit comments