Skip to content

Commit 074b623

Browse files
authored
Added slugified name option. (#156)
1 parent dec4617 commit 074b623

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ can use the following substitutions:
205205

206206
- `SN`; the device serial number
207207
- `N`; the device name
208+
- `NN`; the device name, lower case with _ replacing spaces
208209
- `Y`; the year of the recording, include century
209210
- `m`; the month of the year as a number (range 01 to 12)
210211
- `d`; the day of the month as a number (range 01 to 31)

changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
0.8.0.8
22
Better login error handling and reporting.
3+
Added slugified naming option
34
0.8.0.7
45
Add Essential Indoor Gen 2 support.
56
0.8.0.6

pyaarlo/media.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import threading
33
from datetime import datetime, timedelta
44
from string import Template
5+
from slugify import slugify
56

67
from .constant import (
78
LIBRARY_PATH,
@@ -47,6 +48,7 @@ def _output_name(self, media):
4748
Template(self._save_format).substitute(
4849
SN=media.camera.device_id,
4950
N=media.camera.name,
51+
NN=slugify(media.camera.name, separator='_'),
5052
Y=Y,
5153
m=m,
5254
d=d,

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ unidecode
55
cloudscraper>=1.2.71
66
paho-mqtt
77
cryptography
8+
slugify

0 commit comments

Comments
 (0)