Welcome, Guest
Submit ComicRack bugs to get them squashed

TOPIC: Some API objects returning incorrect value if book has never been opened

Some API objects returning incorrect value if book has never been opened 3 years 7 months ago #38652

  • cagenut
  • cagenut's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
It looks like if you haven't ever opened the book then book.Pages.Count always returns a value of 2
If you have opened the book previously then the correct value is returned

book.MovePages also exhibits the same behaviour

book.PageCount returns the correct value even if the book has never been opened
The administrator has disabled public write access.

Some API objects returning incorrect value if book has never been opened 3 years 7 months ago #38766

  • cagenut
  • cagenut's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Here is my test code:
################################################################################
#
#	Test values returned by API
#
################################################################################

#@Name	API Test
#@Hook Books

def APITest(books):
	for book in books:
		print 'book.OpenedCount:', book.OpenedCount
		print 'book.Pages.Count:', book.Pages.Count
		print 'book.PageCount:', book.PageCount

The result when run on a book that hasn't previously been opened:
Calling 'APITest'...
book.OpenedCount: 0
book.Pages.Count: 2
book.PageCount: 41
and after opening then closing the book:
Calling 'APITest'...
book.OpenedCount: 1
book.Pages.Count: 41
book.PageCount: 41
The administrator has disabled public write access.
Time to create page: 0.274 seconds

Who's Online

We have 252 guests and 4 members online