initial commit
This commit is contained in:
21
src/komgapi/endpoints/announcement_controller.py
Normal file
21
src/komgapi/endpoints/announcement_controller.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from .baseapi import BaseAPI
|
||||
import pathlib
|
||||
import subprocess
|
||||
import requests
|
||||
import typing_extensions
|
||||
from typing import List, Optional, Dict, Any, Union
|
||||
from komgapi.errors import KomgaError, LoginError, ResultErrror
|
||||
from komgapi.schemas import * # Progress, Series
|
||||
|
||||
|
||||
class AnnouncementController(BaseAPI):
|
||||
def __init__(self, username, password, url, timeout=20) -> None:
|
||||
super().__init__(username, password, url, timeout)
|
||||
|
||||
def getAnnouncements(self) -> List[Announcement]:
|
||||
url = self.url + "announcements"
|
||||
data = self.getRequest(url)
|
||||
ret = []
|
||||
for announcement in data:
|
||||
ret.append(Announcement(**announcement))
|
||||
return ret
|
||||
Reference in New Issue
Block a user