theslavicbear / Ebook-Publisher

A Python tool for converting online stories into portable formats
MIT License
35 stars 2 forks source link

Make -n check creation date and last update #68

Closed SomeRandomDude870 closed 3 years ago

SomeRandomDude870 commented 4 years ago

Hi, I would like to recommend that -n or some other flag checks when the Story was last updated and then also checks when the corresponding file on the drive was created.

If there was no update since the creation date it should just do nothing.

This would be a better behavior to the current one where it only checks if the File exists or not. This should be done quite simply, I would do it myself, but I have no idea of Python.

SomeRandomDude870 commented 4 years ago

Okay, I have checked it myself, no idea if it works. In Chyoa: date= soup.findall("p",class="dates").strong time=datetime.strptime(date,%b %-d, %Y) .... Common.checkDuplicate(self.title,time) (although, I have no idea if the correct Frame on the right side will be shown.)

def checkDuplicate(title,lastUpdate=None): if lastUpdate: creationTime= time.ctime(os.path.getctime(os.path.isfile(wd+title+'.epub'))) return lastUpdate < creationTime ...... etc Logically it should work like that.

theslavicbear commented 3 years ago

Good idea. Low priority as of now. Could also check based on number of chapters by implanting some metadata into the output files (wouldn't work for .txt probably), since I find file timestamps can be changed by some system operations.

theslavicbear commented 3 years ago

Similar to #64. I don't have current plans to add more robust update functionality, but I will leave open for future possibilities.

SomeRandomDude870 commented 3 years ago

Shame. Thought it might be easy to write - for someone who knows Python.

theslavicbear commented 3 years ago

Added in release 3.2.0. Thanks for checking on how to do this.