Skip to content

Commit

Permalink
For fpcalc use normpath instead of win_prefix_longpath
Browse files Browse the repository at this point in the history
This is platform independent and also handles the case where the system
has native support for long paths.
  • Loading branch information
phw committed Sep 17, 2023
1 parent 27ed598 commit c9b9871
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions picard/acoustid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Copyright (C) 2017-2018 Sambhav Kothari
# Copyright (C) 2018 Vishal Choudhary
# Copyright (C) 2018-2021 Laurent Monin
# Copyright (C) 2018-2022 Philipp Wolfer
# Copyright (C) 2018-2023 Philipp Wolfer
# Copyright (C) 2023 Bob Swift
#
# This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -40,11 +40,10 @@
DEFAULT_FPCALC_THREADS,
FPCALC_NAMES,
)
from picard.const.sys import IS_WIN
from picard.file import File
from picard.util import (
find_executable,
win_prefix_longpath,
normpath,
)


Expand Down Expand Up @@ -259,9 +258,7 @@ def _run_next_task(self):
process.setProperty('picard_finished', False)
process.finished.connect(partial(self._on_fpcalc_finished, task))
process.error.connect(partial(self._on_fpcalc_error, task))
file_path = task.file.filename
if IS_WIN:
file_path = win_prefix_longpath(file_path)
file_path = normpath(task.file.filename)
process.start(self._fpcalc, ["-json", "-length", "120", file_path])
log.debug("Starting fingerprint calculator %r %r", self._fpcalc, task.file.filename)

Expand Down

0 comments on commit c9b9871

Please sign in to comment.