digitalec / deemon

Monitor specified artists for new releases
GNU General Public License v3.0
176 stars 15 forks source link

E-mail notifications failing | ValueError: Invalid format string #15

Closed tordenflesk closed 3 years ago

tordenflesk commented 3 years ago
deemon -v refresh
2021-07-10 02:37:02 [DEBUG] deemon.app.refresh: Refreshing artists
2021-07-10 02:37:07 [DEBUG] deemon.app.refresh: queue: added Brookes Brothers - So Many Times / Now I'm Found (Remixes) (Club Masters) to the queue
2021-07-10 02:37:07 [DEBUG] deemon.app.refresh: queue: added Brookes Brothers - Flashing Lights (Kilian & Jo Mix) to the queue
2021-07-10 02:37:07 [DEBUG] deemon.app.refresh: queue: added Brookes Brothers - Movin' On (Extended DJ Edit) to the queue
2021-07-10 02:37:07 [DEBUG] deemon.app.refresh: queue: added Brookes Brothers - Acts of Mad Men (Part 4) to the queue
2021-07-10 02:37:07 [INFO] deemon.app.refresh: Brookes Brothers: 4 new release(s)
2021-07-10 02:37:07 [DEBUG] deemon.app.refresh: queue: added Camo & Krooked - Acts of Mad Men (Part 1) to the queue
2021-07-10 02:37:07 [DEBUG] deemon.app.refresh: queue: added Camo & Krooked - Get Funky to the queue
2021-07-10 02:37:07 [INFO] deemon.app.refresh: Camo & Krooked: 2 new release(s)
2021-07-10 02:37:26 [DEBUG] deemon.app.refresh: queue: added Nero - Acts of Mad Men (Part 2) to the queue
2021-07-10 02:37:26 [INFO] deemon.app.refresh: Nero: 1 new release(s)
Refreshing: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 301/301 (00:40)
2021-07-10 02:37:43 [DEBUG] deemon.app.refresh: Refresh complete

2021-07-10 02:37:43 [DEBUG] deemon.app.dmi: Initializing deemix library
2021-07-10 02:37:43 [INFO] deemon.app.dmi: Verifying ARL is valid, please wait...
2021-07-10 02:37:43 [DEBUG] deemon.app.dmi: ARL found: XX
XX
2021-07-10 02:37:43 [INFO] deemon.app.download: ----------------------------
2021-07-10 02:37:43 [INFO] deemon.app.download: Sending 7 release(s) to deemix for download:
2021-07-10 02:37:43 [INFO] deemon.app.download: + Brookes Brothers - So Many Times / Now I'm Found (Remixes) (Club Masters)...
2021-07-10 02:39:30 [INFO] deemon.app.download: + Brookes Brothers - Flashing Lights (Kilian & Jo Mix)...
2021-07-10 02:39:48 [INFO] deemon.app.download: + Brookes Brothers - Movin' On (Extended DJ Edit)...
2021-07-10 02:39:51 [INFO] deemon.app.download: + Brookes Brothers - Acts of Mad Men (Part 4)...
2021-07-10 02:39:59 [INFO] deemon.app.download: + Camo & Krooked - Acts of Mad Men (Part 1)...
2021-07-10 02:40:06 [INFO] deemon.app.download: + Camo & Krooked - Get Funky...
2021-07-10 02:40:13 [INFO] deemon.app.download: + Nero - Acts of Mad Men (Part 2)...

2021-07-10 02:40:24 [INFO] deemon.app.download: Downloads complete!
2021-07-10 02:40:24 [DEBUG] deemon.app.notify: notify initialized
2021-07-10 02:40:24 [DEBUG] deemon.app.notify: releases to notify on: [{'release_date': '2018-03-23', 'releases': [{'artist': 'Brookes Brothers', 'album': "S
o Many Times / Now I'm Found (Remixes) (Club Masters)"}]}, {'release_date': '2018-02-02', 'releases': [{'artist': 'Brookes Brothers', 'album': 'Flashing Ligh
ts (Kilian & Jo Mix)'}]}, {'release_date': '2017-09-08', 'releases': [{'artist': 'Brookes Brothers', 'album': "Movin' On (Extended DJ Edit)"}]}, {'release_da
te': '2009-10-26', 'releases': [{'artist': 'Brookes Brothers', 'album': 'Acts of Mad Men (Part 4)'}]}, {'release_date': '2009-09-14', 'releases': [{'artist':
 'Camo & Krooked', 'album': 'Acts of Mad Men (Part 1)'}]}, {'release_date': '2009-03-31', 'releases': [{'artist': 'Camo & Krooked', 'album': 'Get Funky'}]},
{'release_date': '2009-09-28', 'releases': [{'artist': 'Nero', 'album': 'Acts of Mad Men (Part 2)'}]}]
Traceback (most recent call last):
  File "c:\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python38\Scripts\deemon.exe\__main__.py", line 7, in <module>
  File "c:\python38\lib\site-packages\deemon\__main__.py", line 4, in main
    cli.run()
  File "c:\python38\lib\site-packages\click\core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "c:\python38\lib\site-packages\click\core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "c:\python38\lib\site-packages\click\core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python38\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python38\lib\site-packages\click\core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "c:\python38\lib\site-packages\deemon\cli.py", line 120, in refresh_command
    refresh.refresh()
  File "c:\python38\lib\site-packages\deemon\app\refresh.py", line 139, in refresh
    notification.send()
  File "c:\python38\lib\site-packages\deemon\app\notify.py", line 47, in send
    body = self.build_message()
  File "c:\python38\lib\site-packages\deemon\app\notify.py", line 74, in build_message
    part2 = MIMEText(self.html(), 'html')
  File "c:\python38\lib\site-packages\deemon\app\notify.py", line 150, in html
    release_date_str = datetime.strftime(release_date_ts, "%A, %B %-d")
ValueError: Invalid format string

Windows, Python 3.8.6

digitalec commented 3 years ago

Confirmed. Windows does not support the %-d format for day of month without leading zero.

You can fix this temporarily by changing it to %#d on line 150 in notify.py. I'll fix this properly in the next release.

digitalec commented 3 years ago

Issue resolved in 1.0.8