Check if site is active before downloading shared items catalog

merge-requests/30/head
Bob Mottram 2021-07-29 20:27:36 +01:00
parent 4422c69d7f
commit b232a7593a
1 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,7 @@ from utils import acctDir
from utils import isfloat from utils import isfloat
from media import processMetaData from media import processMetaData
from filters import isFilteredGlobally from filters import isFilteredGlobally
from siteactive import siteIsActive
def _loadDfcIds(baseDir: str, systemLanguage: str) -> {}: def _loadDfcIds(baseDir: str, systemLanguage: str) -> {}:
@ -1173,6 +1174,8 @@ def _updateFederatedSharesCache(session, sharedItemsFederatedDomains: [],
if not tokensJson.get(federatedDomain): if not tokensJson.get(federatedDomain):
# token has been obtained for the other domain # token has been obtained for the other domain
continue continue
if not siteIsActive(httpPrefix + '://' + federatedDomain):
continue
url = httpPrefix + '://' + federatedDomain + '/catalog' url = httpPrefix + '://' + federatedDomain + '/catalog'
asHeader['Authorization'] = tokensJson[federatedDomain] asHeader['Authorization'] = tokensJson[federatedDomain]
catalogJson = getJson(session, url, asHeader, None, catalogJson = getJson(session, url, asHeader, None,