mirror of
https://github.com/tubearchivist/jellyfin.git
synced 2025-07-15 13:38:16 +00:00
Compare commits
No commits in common. "e83720290fc6e0034be2c194960d8e4fe12da358" and "0c54d97e6591c93291a769e6436bd5cec6b3e2c8" have entirely different histories.
e83720290f
...
0c54d97e65
@ -7,12 +7,12 @@ ENV PATH=/root/.local/bin:$PATH
|
|||||||
RUN if [ "$INSTALL_DEBUG" ] ; then \
|
RUN if [ "$INSTALL_DEBUG" ] ; then \
|
||||||
apt-get -y update && apt-get -y install --no-install-recommends \
|
apt-get -y update && apt-get -y install --no-install-recommends \
|
||||||
vim htop bmon net-tools iputils-ping procps curl \
|
vim htop bmon net-tools iputils-ping procps curl \
|
||||||
&& pip install ipython \
|
&& pip install --user ipython \
|
||||||
; fi
|
; fi
|
||||||
|
|
||||||
# install requirements
|
# install requirements
|
||||||
COPY ./requirements.txt /requirements.txt
|
COPY ./requirements.txt /requirements.txt
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install --user -r requirements.txt
|
||||||
|
|
||||||
COPY app /app
|
COPY app /app
|
||||||
WORKDIR app
|
WORKDIR app
|
||||||
|
@ -61,7 +61,7 @@ Mount the `/youtube` folder from Tube Archivist also in this container at `/yout
|
|||||||
### Manual trigger
|
### Manual trigger
|
||||||
For an initial import or for other irregular occasions, trigger the library scan from outside the container, e.g.:
|
For an initial import or for other irregular occasions, trigger the library scan from outside the container, e.g.:
|
||||||
```bash
|
```bash
|
||||||
docker exec tubearchivist-jf python main.py
|
docker exec -it tubearchivist-jf python main.py
|
||||||
```
|
```
|
||||||
|
|
||||||
### Auto trigger
|
### Auto trigger
|
||||||
|
@ -47,9 +47,7 @@ class Library:
|
|||||||
|
|
||||||
def _get_all_series(self) -> dict:
|
def _get_all_series(self) -> dict:
|
||||||
"""get all shows indexed in jf"""
|
"""get all shows indexed in jf"""
|
||||||
path: str = (
|
path: str = f"Items?Recursive=true&IncludeItemTypes=Series&fields=ParentId,Path&ParentId={self.yt_collection}" # noqa: E501
|
||||||
f"Items?Recursive=true&IncludeItemTypes=Series&fields=ParentId,Path&ParentId={self.yt_collection}" # noqa: E501
|
|
||||||
)
|
|
||||||
all_shows: dict = Jellyfin().get(path)
|
all_shows: dict = Jellyfin().get(path)
|
||||||
|
|
||||||
return all_shows
|
return all_shows
|
||||||
@ -73,9 +71,7 @@ class Library:
|
|||||||
|
|
||||||
def refresh_collection(self, collection_id: str) -> None:
|
def refresh_collection(self, collection_id: str) -> None:
|
||||||
"""trigger collection refresh"""
|
"""trigger collection refresh"""
|
||||||
path: str = (
|
path: str = f"Items/{collection_id}/Refresh?Recursive=true&ImageRefreshMode=Default&MetadataRefreshMode=Default" # noqa: E501
|
||||||
f"Items/{collection_id}/Refresh?Recursive=true&ImageRefreshMode=Default&MetadataRefreshMode=Default" # noqa: E501
|
|
||||||
)
|
|
||||||
Jellyfin().post(path, False)
|
Jellyfin().post(path, False)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@ -212,12 +208,10 @@ class Show:
|
|||||||
def _wait_for_season(self, expected_season: str) -> None:
|
def _wait_for_season(self, expected_season: str) -> None:
|
||||||
"""wait for season to be created in JF"""
|
"""wait for season to be created in JF"""
|
||||||
jf_id: str = self.show["Id"]
|
jf_id: str = self.show["Id"]
|
||||||
path: str = (
|
path: str = f"Items/{jf_id}/Refresh?Recursive=true&ImageRefreshMode=Default&MetadataRefreshMode=Default" # noqa: E501
|
||||||
f"Items/{jf_id}/Refresh?Recursive=true&ImageRefreshMode=Default&MetadataRefreshMode=Default" # noqa: E501
|
|
||||||
)
|
|
||||||
print(f"[setup] {path=}")
|
print(f"[setup] {path=}")
|
||||||
Jellyfin().post(path, False)
|
Jellyfin().post(path, False)
|
||||||
for _ in range(24):
|
while True:
|
||||||
all_existing: set[str] = set(self._get_existing_seasons())
|
all_existing: set[str] = set(self._get_existing_seasons())
|
||||||
|
|
||||||
print(f"[setup] seasons: {all_existing} {expected_season=}")
|
print(f"[setup] seasons: {all_existing} {expected_season=}")
|
||||||
@ -236,8 +230,14 @@ class Show:
|
|||||||
path: str = f"Shows/{series_id}/Seasons"
|
path: str = f"Shows/{series_id}/Seasons"
|
||||||
all_seasons: dict = Jellyfin().get(path)
|
all_seasons: dict = Jellyfin().get(path)
|
||||||
|
|
||||||
|
# print(f"[setup] {path=} all_seasons_items={all_seasons['Items']}")
|
||||||
|
|
||||||
return [str(i.get("IndexNumber")) for i in all_seasons["Items"]]
|
return [str(i.get("IndexNumber")) for i in all_seasons["Items"]]
|
||||||
|
|
||||||
|
# res = [str(i.get("Name")) for i in all_seasons["Items"]]
|
||||||
|
|
||||||
|
# return [name.split(' ')[1] if ' ' in name else name for name in res]
|
||||||
|
|
||||||
def delete_folders(self, folders: list[str]) -> None:
|
def delete_folders(self, folders: list[str]) -> None:
|
||||||
"""delete temporary folders created"""
|
"""delete temporary folders created"""
|
||||||
for folder in folders:
|
for folder in folders:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user