talklib 2.0.5__tar.gz → 2.0.7__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.1
2
2
  Name: talklib
3
- Version: 2.0.5
3
+ Version: 2.0.7
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 = "2.0.5"
3
+ version = "2.0.7"
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"}
@@ -179,12 +179,18 @@ class Episode(BaseModel):
179
179
  root = feed.getroot()
180
180
  root = root.find('channel')
181
181
 
182
+ self.notifications.prep_syslog(message="Building the new <item> element")
182
183
  item = ET.Element('item')
183
184
 
184
185
  title = ET.Element('title')
185
186
  title.text = self.episode_title
186
187
  item.append(title)
187
188
 
189
+ # Drupal needs to see a category element on every episode that matches the name of the program
190
+ channel_title_category_element = ET.Element("category")
191
+ channel_title_category_element.text = root.find('title').text
192
+ item.append(channel_title_category_element)
193
+
188
194
  pubDate = ET.Element('pubDate')
189
195
  pubDate.text = self.pub_date()
190
196
  item.append(pubDate)
@@ -216,7 +222,7 @@ class Episode(BaseModel):
216
222
  # If there are existing items (there usually will be), add the new item before to the top
217
223
  first_item = items[0]
218
224
  index = list(root).index(first_item)
219
- self.notifications.prep_syslog(message=f"adding {item} to feed at {index}")
225
+ self.notifications.prep_syslog(message=f"adding {item} to feed at channel index: {index}")
220
226
  root.insert(index, item)
221
227
  else:
222
228
  # If no items exist, add the new item to the bottom (after the other channel elements)
@@ -319,13 +325,17 @@ class TLPod(BaseModel):
319
325
  to_send = f"There was a problem podcasting {self.display_name}. Cannot find matched file {to_match} in {self.audio_folders}"
320
326
  self.notifications.send_notifications(message=to_send, subject='Error')
321
327
  raise FileNotFoundError
322
-
323
- def convert(self, file:str):
328
+
329
+ def create_converted_filename(self, file: str):
324
330
  output_filename = file.split('.')
325
331
  output_filename = output_filename[0]
326
332
  output_filename = os.path.basename(output_filename).lower()
327
333
  output_filename = output_filename + '.mp3'
328
334
  self.notifications.prep_syslog(message=f"Converted audio file will be {output_filename}")
335
+ return output_filename
336
+
337
+ def convert(self, file:str):
338
+ output_filename = self.create_converted_filename(file=file)
329
339
 
330
340
  self.ffmpeg.input_file = file
331
341
  self.ffmpeg.output_file = output_filename
@@ -354,6 +364,7 @@ class TLPod(BaseModel):
354
364
 
355
365
  def run(self):
356
366
  self.notifications.prep_syslog(message="Starting up...")
367
+ self.notifications.prep_syslog(message=f"Attributes: {self.__repr__()}")
357
368
 
358
369
  self.ssh.check_folder_exists(folder=self.bucket_folder)
359
370
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: talklib
3
- Version: 2.0.5
3
+ Version: 2.0.7
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