+ def edit_sale(self, book):
+ assert book.legimi_id
+
+ words = book.wldocument().get_statistics()['total']['words_with_fn']
+
+ price = settings.LEGIMI_SMALL_PRICE
+ if words > settings.LEGIMI_SMALL_WORDS:
+ price = settings.LEGIMI_BIG_PRICE
+
+ abo = 'true' if words > settings.LEGIMI_BIG_WORDS else 'false'
+
+ data = {
+ 'ValidationTrue': 'true',
+ 'Id': book.legimi_id,
+ 'SalesPromotionId': "0",
+ 'IsLibraryPass': "False",
+ 'OriginalEnterToTheMarketType': "No",
+ 'OriginalHidingDate': "",
+ 'OriginalEnterToTheMarketDate': "",
+ 'EnterToTheMarketType': "No",
+ 'EnterToTheMarketDate': "",
+ 'HidingDate': "",
+ 'SalesNoLimitOption': abo,
+ 'SalesNoLimitKindle': abo,
+ 'SalesInStoreEbookGrossValue': f'{price},00',
+ 'SalesPromotion': "False",
+ 'SalesPromotionGrossValue': "0,00",
+ 'SalesPromotionDatesRange.DateStart': "",
+ 'SalesPromotionDatesRange.DateEnd': "",
+ }
+
+ self.session.post(
+ self.EDIT_SALE_URL % book.legimi_id,
+ data=data
+ )
+