mirror of
https://github.com/zebrajr/faceswap.git
synced 2025-12-06 00:20:09 +01:00
bugfix: Alignments - correctly update keys for multiple underscores in the filename
This commit is contained in:
parent
0f947791f5
commit
13dd5b3a90
|
|
@ -140,17 +140,19 @@ class VideoExtension(_Updater):
|
|||
"""
|
||||
updated = 0
|
||||
for key in list(self._alignments.data):
|
||||
val = self._alignments.data[key]
|
||||
fname = os.path.splitext(key)[0]
|
||||
if fname.rsplit("_")[0] != self._video_name:
|
||||
if fname.rsplit("_", maxsplit=1)[0] != self._video_name:
|
||||
continue # Key is from a different source
|
||||
|
||||
val = self._alignments.data[key]
|
||||
new_key = f"{fname}{self._extension}"
|
||||
|
||||
del self._alignments.data[key]
|
||||
self._alignments.data[new_key] = val
|
||||
|
||||
updated += 1
|
||||
|
||||
logger.debug("Updated alignemnt keys for video extension: %s", updated)
|
||||
logger.debug("Updated alignment keys for video extension: %s", updated)
|
||||
return updated
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user