mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-29 11:53:59 +00:00
Use a constant for default number of threads
This commit is contained in:
committed by
Philipp Wolfer
parent
7c4fb2d64d
commit
4f0248633b
@@ -36,7 +36,10 @@ from PyQt5 import QtCore
|
||||
from picard import log
|
||||
from picard.acoustid.json_helpers import parse_recording
|
||||
from picard.config import get_config
|
||||
from picard.const import FPCALC_NAMES
|
||||
from picard.const import (
|
||||
DEFAULT_FPCALC_THREADS,
|
||||
FPCALC_NAMES,
|
||||
)
|
||||
from picard.const.sys import IS_WIN
|
||||
from picard.file import File
|
||||
from picard.util import (
|
||||
@@ -84,7 +87,7 @@ class AcoustIDClient(QtCore.QObject):
|
||||
|
||||
def get_max_processes(self):
|
||||
config = get_config()
|
||||
return config.setting['fpcalc_threads'] or 2
|
||||
return config.setting['fpcalc_threads'] or DEFAULT_FPCALC_THREADS
|
||||
|
||||
def _on_lookup_finished(self, task, document, http, error):
|
||||
doc = {}
|
||||
|
||||
@@ -56,6 +56,7 @@ ACOUSTID_KEY = 'v8pQ6oyB'
|
||||
ACOUSTID_HOST = 'api.acoustid.org'
|
||||
ACOUSTID_PORT = 443
|
||||
FPCALC_NAMES = ['fpcalc', 'pyfpcalc']
|
||||
DEFAULT_FPCALC_THREADS = 2
|
||||
|
||||
# MB OAuth client credentials
|
||||
MUSICBRAINZ_OAUTH_CLIENT_ID = 'ACa9wsDX19cLp-AeEP-vVw'
|
||||
|
||||
@@ -39,6 +39,7 @@ from picard.config import (
|
||||
TextOption,
|
||||
get_config,
|
||||
)
|
||||
from picard.const import DEFAULT_FPCALC_THREADS
|
||||
from picard.util import webbrowser2
|
||||
|
||||
from picard.ui.options import (
|
||||
@@ -71,7 +72,7 @@ class FingerprintingOptionsPage(OptionsPage):
|
||||
TextOption("setting", "fingerprinting_system", "acoustid"),
|
||||
TextOption("setting", "acoustid_fpcalc", ""),
|
||||
TextOption("setting", "acoustid_apikey", ""),
|
||||
IntOption("setting", "fpcalc_threads", 2),
|
||||
IntOption("setting", "fpcalc_threads", DEFAULT_FPCALC_THREADS),
|
||||
]
|
||||
|
||||
def __init__(self, parent=None):
|
||||
|
||||
Reference in New Issue
Block a user