Fix new episodes not being detected
- Set standard safety margin to 60 seconds. Otherwise, you might get many screen refreshes - Fixes #23
This commit is contained in:
parent
04c415604d
commit
5bf1a5a8e0
2 changed files with 20 additions and 13 deletions
|
@ -1347,12 +1347,12 @@ class LibrarySync(Thread):
|
||||||
# We haven't waited long enough for the PMS to finish
|
# We haven't waited long enough for the PMS to finish
|
||||||
# processing the item. Do it later
|
# processing the item. Do it later
|
||||||
continue
|
continue
|
||||||
if item['state'] == 5:
|
if item['state'] == 9:
|
||||||
if self.process_newitems(item) is True:
|
|
||||||
deleteListe.append(i)
|
|
||||||
elif item['state'] == 9:
|
|
||||||
if self.process_deleteditems(item) is True:
|
if self.process_deleteditems(item) is True:
|
||||||
deleteListe.append(i)
|
deleteListe.append(i)
|
||||||
|
else:
|
||||||
|
if self.process_newitems(item) is True:
|
||||||
|
deleteListe.append(i)
|
||||||
|
|
||||||
# Get rid of the items we just processed
|
# Get rid of the items we just processed
|
||||||
if len(deleteListe) > 0:
|
if len(deleteListe) > 0:
|
||||||
|
@ -1423,15 +1423,22 @@ class LibrarySync(Thread):
|
||||||
"processing queue" for later
|
"processing queue" for later
|
||||||
"""
|
"""
|
||||||
for item in data:
|
for item in data:
|
||||||
state = item.get('state')
|
|
||||||
typus = item.get('type')
|
typus = item.get('type')
|
||||||
if state == 9 or (state == 5 and typus in (1, 4, 10)):
|
state = item.get('state')
|
||||||
self.itemsToProcess.append({
|
if state == 9 or typus in (1, 4, 10):
|
||||||
'state': state,
|
itemId = item.get('itemID')
|
||||||
'type': typus,
|
# Have we already added this element?
|
||||||
'ratingKey': item.get('itemID'),
|
for existingItem in self.itemsToProcess:
|
||||||
'timestamp': utils.getUnixTimestamp()
|
if existingItem['ratingKey'] == itemId:
|
||||||
})
|
break
|
||||||
|
else:
|
||||||
|
# Haven't added this element to the queue yet
|
||||||
|
self.itemsToProcess.append({
|
||||||
|
'state': state,
|
||||||
|
'type': typus,
|
||||||
|
'ratingKey': itemId,
|
||||||
|
'timestamp': utils.getUnixTimestamp()
|
||||||
|
})
|
||||||
|
|
||||||
def process_playing(self, data):
|
def process_playing(self, data):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
|
|
||||||
<setting type="lsep" label="39052" /><!-- Background Sync -->
|
<setting type="lsep" label="39052" /><!-- Background Sync -->
|
||||||
<setting id="enableBackgroundSync" type="bool" label="39026" default="true" visible="true"/>
|
<setting id="enableBackgroundSync" type="bool" label="39026" default="true" visible="true"/>
|
||||||
<setting id="saftyMargin" type="slider" label="39051" default="30" option="int" range="10,1,300" visible="eq(-1,true)"/>
|
<setting id="saftyMargin" type="slider" label="39051" default="60" option="int" range="10,1,300" visible="eq(-1,true)"/>
|
||||||
<setting id="fullSyncInterval" type="number" label="39053" default="60" option="int" />
|
<setting id="fullSyncInterval" type="number" label="39053" default="60" option="int" />
|
||||||
|
|
||||||
<setting type="lsep" label="30538" /><!-- Complete Re-Sync necessary -->
|
<setting type="lsep" label="30538" /><!-- Complete Re-Sync necessary -->
|
||||||
|
|
Loading…
Reference in a new issue