Skip to content

Commit b961b16

Browse files
fix(#6): remove timespan validator
1 parent fbdaa0f commit b961b16

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

sonarr/models/command_resource.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from datetime import datetime
2020
from typing import Optional
21-
from pydantic import BaseModel, validator
21+
from pydantic import BaseModel
2222
from sonarr.models.command import Command
2323
from sonarr.models.command_priority import CommandPriority
2424
from sonarr.models.command_status import CommandStatus
@@ -50,12 +50,6 @@ class CommandResource(BaseModel):
5050
last_execution_time: Optional[datetime]
5151
__properties = ["id", "name", "commandName", "message", "body", "priority", "status", "queued", "started", "ended", "duration", "exception", "trigger", "clientUserAgent", "stateChangeTime", "sendUpdatesToClient", "updateScheduledTask", "lastExecutionTime"]
5252

53-
@validator('duration')
54-
def duration_validate_regular_expression(cls, v):
55-
if not re.match(r"\d{2}:\d{2}:\d{2}", v):
56-
raise ValueError(r"must validate the regular expression /\d{2}:\d{2}:\d{2}/")
57-
return v
58-
5953
class Config:
6054
allow_population_by_field_name = True
6155
validate_assignment = True

sonarr/models/import_list_resource.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
from typing import List, Optional
21-
from pydantic import BaseModel, validator
21+
from pydantic import BaseModel
2222
from sonarr.models.field import Field
2323
from sonarr.models.import_list_type import ImportListType
2424
from sonarr.models.monitor_types import MonitorTypes
@@ -52,12 +52,6 @@ class ImportListResource(BaseModel):
5252
min_refresh_interval: Optional[str]
5353
__properties = ["id", "name", "fields", "implementationName", "implementation", "configContract", "infoLink", "message", "tags", "presets", "enableAutomaticAdd", "shouldMonitor", "rootFolderPath", "qualityProfileId", "seriesType", "seasonFolder", "listType", "listOrder", "minRefreshInterval"]
5454

55-
@validator('min_refresh_interval')
56-
def min_refresh_interval_validate_regular_expression(cls, v):
57-
if not re.match(r"\d{2}:\d{2}:\d{2}", v):
58-
raise ValueError(r"must validate the regular expression /\d{2}:\d{2}:\d{2}/")
59-
return v
60-
6155
class Config:
6256
allow_population_by_field_name = True
6357
validate_assignment = True

sonarr/models/queue_resource.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from datetime import datetime
2020
from typing import List, Optional
21-
from pydantic import BaseModel, validator
21+
from pydantic import BaseModel
2222
from sonarr.models.custom_format_resource import CustomFormatResource
2323
from sonarr.models.download_protocol import DownloadProtocol
2424
from sonarr.models.episode_resource import EpisodeResource
@@ -60,12 +60,6 @@ class QueueResource(BaseModel):
6060
output_path: Optional[str]
6161
__properties = ["id", "seriesId", "episodeId", "series", "episode", "languages", "quality", "customFormats", "size", "title", "sizeleft", "timeleft", "estimatedCompletionTime", "status", "trackedDownloadStatus", "trackedDownloadState", "statusMessages", "errorMessage", "downloadId", "protocol", "downloadClient", "indexer", "outputPath"]
6262

63-
@validator('timeleft')
64-
def timeleft_validate_regular_expression(cls, v):
65-
if not re.match(r"\d{2}:\d{2}:\d{2}", v):
66-
raise ValueError(r"must validate the regular expression /\d{2}:\d{2}:\d{2}/")
67-
return v
68-
6963
class Config:
7064
allow_population_by_field_name = True
7165
validate_assignment = True

sonarr/models/task_resource.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from datetime import datetime
2020
from typing import Optional
21-
from pydantic import BaseModel, validator
21+
from pydantic import BaseModel
2222

2323
class TaskResource(BaseModel):
2424
"""NOTE: This class is auto generated by OpenAPI Generator.
@@ -36,12 +36,6 @@ class TaskResource(BaseModel):
3636
last_duration: Optional[str]
3737
__properties = ["id", "name", "taskName", "interval", "lastExecution", "lastStartTime", "nextExecution", "lastDuration"]
3838

39-
@validator('last_duration')
40-
def last_duration_validate_regular_expression(cls, v):
41-
if not re.match(r"\d{2}:\d{2}:\d{2}", v):
42-
raise ValueError(r"must validate the regular expression /\d{2}:\d{2}:\d{2}/")
43-
return v
44-
4539
class Config:
4640
allow_population_by_field_name = True
4741
validate_assignment = True

0 commit comments

Comments
 (0)