fixed: do not write resumepoint to NFO if its value is 0 because this will set the lastplayed field to the import date

This commit is contained in:
Marcel van der Veldt 2015-03-24 21:19:50 +01:00
parent 95a3e76671
commit 2d531474d7

View file

@ -167,9 +167,10 @@ class CreateFiles():
if timeInfo.get("ResumeTime") != None: if timeInfo.get("ResumeTime") != None:
resume_sec = int(round(float(timeInfo.get("ResumeTime"))))*60 resume_sec = int(round(float(timeInfo.get("ResumeTime"))))*60
total_sec = int(round(float(timeInfo.get("TotalTime"))))*60 total_sec = int(round(float(timeInfo.get("TotalTime"))))*60
resume = SubElement(root, "resume") if resume_sec != 0:
SubElement(resume, "position").text = str(resume_sec) resume = SubElement(root, "resume")
SubElement(resume, "total").text = str(total_sec) SubElement(resume, "position").text = str(resume_sec)
SubElement(resume, "total").text = str(total_sec)
if item_type == "Episode": if item_type == "Episode":
SubElement(root, "season").text = str(item.get("ParentIndexNumber")) SubElement(root, "season").text = str(item.get("ParentIndexNumber"))