talklib 3.3.1__tar.gz → 3.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: talklib
3
- Version: 3.3.1
3
+ Version: 3.4.0
4
4
  Summary: A package to automate processing of shows/segments airing on the TL
5
5
  Author-email: Ben Weddle <ben.weddle@gmail.com>
6
6
  Maintainer-email: Ben Weddle <ben.weddle@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "talklib"
3
- version = "3.3.1"
3
+ version = "3.4.0"
4
4
  description = "A package to automate processing of shows/segments airing on the TL"
5
5
  readme = "README.md"
6
6
  license = {file = "LICENSE.txt"}
@@ -360,6 +360,7 @@ class TLPod(BaseModel):
360
360
  bucket_folder: str = Field(default=None)
361
361
  max_episodes_in_feed: int = Field(ge=1, default=5)
362
362
  override_filename: bool = False
363
+ short_timestamp: bool = False
363
364
  audio_folders:list = EV().destinations
364
365
  notifications: Type[Notifications] = Notifications()
365
366
  episode: Type[Episode] = Episode()
@@ -381,7 +382,10 @@ class TLPod(BaseModel):
381
382
  prefix = f"{self.display_name} (podcast)"
382
383
  Notifications.prefix = prefix
383
384
 
384
- self.display_name = f"{self.display_name} ({datetime.now().strftime('%a, %d %b')})"
385
+ if self.short_timestamp:
386
+ self.display_name = f"{self.display_name} ({self.short_timestamp_for_display_name()})"
387
+ else:
388
+ self.display_name = f"{self.display_name} ({datetime.now().strftime('%a, %d %b')})"
385
389
 
386
390
  return self
387
391
 
@@ -396,6 +400,15 @@ class TLPod(BaseModel):
396
400
  # raise e
397
401
 
398
402
  # return self
403
+ def short_timestamp_for_display_name(self):
404
+ day_of_week: str = datetime.now().strftime("%A") # Weekday as locale’s full name.
405
+ hour: str = datetime.now().strftime('%I') # Hour (12-hour clock) as a zero-padded decimal number.
406
+ ampm: str = datetime.now().strftime("%p") # Locale’s equivalent of either AM or PM.
407
+
408
+ if hour == "00":
409
+ hour = "12"
410
+
411
+ return f"{day_of_week} {hour}{ampm}"
399
412
 
400
413
  def get_filename_to_match(self) -> str:
401
414
  if self.override_filename:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: talklib
3
- Version: 3.3.1
3
+ Version: 3.4.0
4
4
  Summary: A package to automate processing of shows/segments airing on the TL
5
5
  Author-email: Ben Weddle <ben.weddle@gmail.com>
6
6
  Maintainer-email: Ben Weddle <ben.weddle@gmail.com>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes