Skip to content

Commit

Permalink
Added slugified name option. (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
twrecked authored Aug 15, 2024
1 parent dec4617 commit 074b623
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ can use the following substitutions:

- `SN`; the device serial number
- `N`; the device name
- `NN`; the device name, lower case with _ replacing spaces
- `Y`; the year of the recording, include century
- `m`; the month of the year as a number (range 01 to 12)
- `d`; the day of the month as a number (range 01 to 31)
Expand Down
1 change: 1 addition & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
0.8.0.8
Better login error handling and reporting.
Added slugified naming option
0.8.0.7
Add Essential Indoor Gen 2 support.
0.8.0.6
Expand Down
2 changes: 2 additions & 0 deletions pyaarlo/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import threading
from datetime import datetime, timedelta
from string import Template
from slugify import slugify

from .constant import (
LIBRARY_PATH,
Expand Down Expand Up @@ -47,6 +48,7 @@ def _output_name(self, media):
Template(self._save_format).substitute(
SN=media.camera.device_id,
N=media.camera.name,
NN=slugify(media.camera.name, separator='_'),
Y=Y,
m=m,
d=d,
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ unidecode
cloudscraper>=1.2.71
paho-mqtt
cryptography
slugify

0 comments on commit 074b623

Please sign in to comment.