changed time formats for livetime metadata, chunk timestamps to avoid localized names -- fixes #538

This commit is contained in:
Hazel Shanks 2020-09-07 12:25:10 +12:00 committed by Jim Miller
parent b0faa2ce21
commit a42a349e3c
3 changed files with 7 additions and 7 deletions

View file

@ -1682,7 +1682,7 @@ legend_spoilers:true
show_spoiler_tags:false
## don't fetch covers marked as nsfw. covers for fiction.live can't be pornographic, but can get very close.
show_nsfw_cover_images:false
## displays the timestamps on the story chunks, showing when each part went live.
## displays the timestamps on the story chunks, showing when each part went live.
show_timestamps:false
## site has more original than fan fiction
@ -1693,6 +1693,7 @@ extra_titlepage_entries:key_tags, tags, likes, live, reader_input
key_tags_label:Key Tags
tags_label:Tags
live_label:Next Live Session
live_format:%%Y-%%m-%%d at %%H:%%M %%p
likes_label:Likes
reader_input_label:Reader Input
keep_in_order_tags:true

View file

@ -38,7 +38,7 @@ from .base_adapter import BaseSiteAdapter
from ..htmlcleanup import stripHTML
from .. import exceptions as exceptions
from ..six import text_type as unicode
from ..six import text_type as unicode, ensure_text
def getClass():
return FictionLiveAdapter
@ -148,7 +148,7 @@ class FictionLiveAdapter(BaseSiteAdapter):
self.story.setMetadata('live', "Now! (at time of download)")
elif 'nextLive' in data and data['nextLive']:
# formatted to match site, not other fanficfare timestamps
next_live_time = self.parse_timestamp(data['nextLive']).strftime("%b %d, %Y at %H:%M %p")
next_live_time = self.parse_timestamp(data['nextLive'])
self.story.setMetadata('live', next_live_time)
show_nsfw_cover_images = self.getConfig('show_nsfw_cover_images')
@ -247,7 +247,7 @@ class FictionLiveAdapter(BaseSiteAdapter):
show_timestamps = self.getConfig('show_timestamps')
if show_timestamps and 'ct' in chunk:
#logger.debug("Adding timestamp for chunk...")
timestamp = self.parse_timestamp(chunk['ct']).strftime("%b %d, %Y %H:%M %p")
timestamp = six.ensure_text(self.parse_timestamp(chunk['ct']).strftime("%x -- %X"))
text += '<div class="ut">' + timestamp + '</div>'
text += "</div><br />\n"
@ -437,8 +437,6 @@ class FictionLiveAdapter(BaseSiteAdapter):
# in future, I'd like to handle audio embeds somehow. but they're not availble to add to stories right now.
# pretty sure they'll just format as a link (with a special tydai-audio class) and should be easier than achievements
# TODO: ETAs on livetimes? to match site formatting and help debugging timezone handling
# TODO:
# set fanficfare plugin to use "overwrite if newer" ? or 'update epub always' ?
# a lot of times, chunks will be added even when chapters/bookmarks don't change

View file

@ -1713,7 +1713,7 @@ legend_spoilers:true
show_spoiler_tags:false
## don't fetch covers marked as nsfw. covers for fiction.live can't be pornographic, but can get very close.
show_nsfw_cover_images:false
## displays the timestamps on the story chunks, showing when each part went live.
## displays the timestamps on the story chunks, showing when each part went live.
show_timestamps:false
## site has more original than fan fiction
@ -1724,6 +1724,7 @@ extra_titlepage_entries:key_tags, tags, likes, live, reader_input
key_tags_label:Key Tags
tags_label:Tags
live_label:Next Live Session
live_format:%%Y-%%m-%%d at %%H:%%M %%p
likes_label:Likes
reader_input_label:Reader Input
keep_in_order_tags:true