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
|
||||
# processing the item. Do it later
|
||||
continue
|
||||
if item['state'] == 5:
|
||||
if self.process_newitems(item) is True:
|
||||
deleteListe.append(i)
|
||||
elif item['state'] == 9:
|
||||
if item['state'] == 9:
|
||||
if self.process_deleteditems(item) is True:
|
||||
deleteListe.append(i)
|
||||
else:
|
||||
if self.process_newitems(item) is True:
|
||||
deleteListe.append(i)
|
||||
|
||||
# Get rid of the items we just processed
|
||||
if len(deleteListe) > 0:
|
||||
|
@ -1423,15 +1423,22 @@ class LibrarySync(Thread):
|
|||
"processing queue" for later
|
||||
"""
|
||||
for item in data:
|
||||
state = item.get('state')
|
||||
typus = item.get('type')
|
||||
if state == 9 or (state == 5 and typus in (1, 4, 10)):
|
||||
self.itemsToProcess.append({
|
||||
'state': state,
|
||||
'type': typus,
|
||||
'ratingKey': item.get('itemID'),
|
||||
'timestamp': utils.getUnixTimestamp()
|
||||
})
|
||||
state = item.get('state')
|
||||
if state == 9 or typus in (1, 4, 10):
|
||||
itemId = item.get('itemID')
|
||||
# Have we already added this element?
|
||||
for existingItem in self.itemsToProcess:
|
||||
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):
|
||||
"""
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
<setting type="lsep" label="39052" /><!-- Background Sync -->
|
||||
<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 type="lsep" label="30538" /><!-- Complete Re-Sync necessary -->
|
||||
|
|
Loading…
Reference in a new issue