diff --git a/app/src/components/Archive.js b/app/src/components/Archive.js index 65df5d80..a2e7c9fb 100644 --- a/app/src/components/Archive.js +++ b/app/src/components/Archive.js @@ -20,6 +20,7 @@ import { BackButton, CardLink, defaultSearchOrder, + epochToDateString, ExternalCardLink, FileIcon, HelpHeader, @@ -29,7 +30,6 @@ import { SearchInput, TabLinks, textEllipsis, - epochToDateString, useTitle } from "./Common"; import {deleteArchives, postDownload} from "../api"; diff --git a/app/src/components/Channels.js b/app/src/components/Channels.js index 9151724b..4faf0d8a 100644 --- a/app/src/components/Channels.js +++ b/app/src/components/Channels.js @@ -14,7 +14,6 @@ import { TableRow, } from "semantic-ui-react"; import {createChannel, deleteChannel, downloadChannel, refreshChannel, updateChannel, validateRegex} from "../api"; -import Container from "semantic-ui-react/dist/commonjs/elements/Container"; import { BackButton, DirectoryInput, diff --git a/app/src/components/Inventory.js b/app/src/components/Inventory.js index b23b7375..859a8435 100644 --- a/app/src/components/Inventory.js +++ b/app/src/components/Inventory.js @@ -77,7 +77,7 @@ function InventorySummary() { } - if (!isEmpty(bySubcategory )) { + if (!isEmpty(bySubcategory)) { return diff --git a/app/src/components/Videos.js b/app/src/components/Videos.js index a8316aa7..f8ede548 100644 --- a/app/src/components/Videos.js +++ b/app/src/components/Videos.js @@ -6,6 +6,7 @@ import { defaultSearchOrder, defaultVideoOrder, Duration, + epochToDateString, FileIcon, isEmpty, mimetypeColor, @@ -14,7 +15,6 @@ import { SearchInput, TabLinks, textEllipsis, - epochToDateString, useTitle } from "./Common" import VideoPage from "./VideoPlayer"; diff --git a/app/src/logo.svg b/app/src/logo.svg index 2e5df0d3..2de20f7c 100644 --- a/app/src/logo.svg +++ b/app/src/logo.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + diff --git a/modules/inventory/api.py b/modules/inventory/api.py index 17abc179..c92e0395 100644 --- a/modules/inventory/api.py +++ b/modules/inventory/api.py @@ -5,10 +5,10 @@ from sanic.request import Request from sanic_ext import validate from sanic_ext.extensions.openapi import openapi +from modules.inventory import common, inventory, schema from wrolpi.common import run_after, recursive_map from wrolpi.errors import ValidationError from wrolpi.root_api import get_blueprint, json_response -from modules.inventory import common, inventory, schema NAME = 'inventory' diff --git a/modules/map/api.py b/modules/map/api.py index 99cae70b..19481825 100644 --- a/modules/map/api.py +++ b/modules/map/api.py @@ -1,4 +1,3 @@ -import asyncio from http import HTTPStatus from pathlib import Path diff --git a/modules/videos/__init__.py b/modules/videos/__init__.py index 7e646789..46d084f0 100644 --- a/modules/videos/__init__.py +++ b/modules/videos/__init__.py @@ -100,7 +100,7 @@ def video_modeler(groups: Dict[str, List[File]], session: Session): @register_after_refresh @limit_concurrent(1) def video_cleanup(): - # Claim all Videos in a Channel's directory for that Channel. + # Claim all Videos in a Channel's directory for that Channel. But, only if they have not yet been claimed. logger.info('Claiming Videos for their Channels') with get_db_curs(commit=True) as curs: curs.execute(''' diff --git a/modules/videos/channel/api.py b/modules/videos/channel/api.py index 95a6766c..3089b997 100644 --- a/modules/videos/channel/api.py +++ b/modules/videos/channel/api.py @@ -9,7 +9,7 @@ from sanic_ext.extensions.openapi import openapi from wrolpi.common import logger, wrol_mode_check, make_media_directory, \ get_media_directory, run_after -from wrolpi.errors import UnknownDirectory, UnknownChannel +from wrolpi.errors import UnknownChannel from wrolpi.root_api import json_response from wrolpi.schema import JSONErrorResponse from wrolpi.vars import PYTEST diff --git a/modules/videos/channel/lib.py b/modules/videos/channel/lib.py index 02a654af..a5893af3 100644 --- a/modules/videos/channel/lib.py +++ b/modules/videos/channel/lib.py @@ -1,6 +1,5 @@ -import functools from pathlib import Path -from typing import List, Dict, Union, Optional +from typing import List, Dict, Union from sqlalchemy.orm import Session from sqlalchemy.orm.exc import NoResultFound diff --git a/modules/videos/common.py b/modules/videos/common.py index 95ddc922..202c9d83 100644 --- a/modules/videos/common.py +++ b/modules/videos/common.py @@ -8,7 +8,7 @@ from datetime import timedelta from decimal import Decimal from functools import partial from pathlib import Path -from typing import List, Set, Iterable, Optional, Tuple +from typing import List, Optional, Tuple import PIL from PIL import Image diff --git a/modules/videos/test/test_downloader.py b/modules/videos/test/test_downloader.py index 3e46b863..bf296476 100644 --- a/modules/videos/test/test_downloader.py +++ b/modules/videos/test/test_downloader.py @@ -457,7 +457,7 @@ async def test_download_destination(test_session, test_directory, video_download video_download_manager.create_download('https://example.com/1', downloader=VideoDownloader.name) await video_download_manager.wait_for_all_downloads() # Output directory matches the channel directory. - assert mock_video_prepare_filename.call_args_list[0].kwargs['ydl'].params['outtmpl']['default']\ + assert mock_video_prepare_filename.call_args_list[0].kwargs['ydl'].params['outtmpl']['default'] \ .startswith(f'{test_directory}/videos/channel name/%(uploader)s') mock_video_prepare_filename.reset_mock() @@ -466,9 +466,10 @@ async def test_download_destination(test_session, test_directory, video_download video_download_manager.create_download('https://example.com/2', downloader=VideoDownloader.name, settings=settings) await video_download_manager.wait_for_all_downloads() # Output directory matches the custom directory specified. - assert mock_video_prepare_filename.call_args_list[0].kwargs['ydl'].params['outtmpl']['default']\ + assert mock_video_prepare_filename.call_args_list[0].kwargs['ydl'].params['outtmpl']['default'] \ .startswith(f'{test_directory}/custom/%(uploader)s') + example_playlist_json = { '_type': 'playlist', 'availability': None, diff --git a/modules/videos/test/test_lib.py b/modules/videos/test/test_lib.py index 3f777200..5de1bf30 100644 --- a/modules/videos/test/test_lib.py +++ b/modules/videos/test/test_lib.py @@ -1,4 +1,3 @@ -import json import pathlib import shutil @@ -10,11 +9,9 @@ from modules.videos.common import apply_info_json from modules.videos.lib import parse_video_file_name, validate_video, get_statistics from modules.videos.models import Video from modules.videos.video.lib import search_videos -from wrolpi.dates import strptime from wrolpi.files import lib as files_lib from wrolpi.files.lib import refresh_files from wrolpi.files.models import File -from wrolpi.test.common import skip_circleci from wrolpi.vars import PROJECT_DIR diff --git a/wrolpi/common.py b/wrolpi/common.py index 224a1819..95e38fcf 100644 --- a/wrolpi/common.py +++ b/wrolpi/common.py @@ -94,6 +94,7 @@ __all__ = [ 'truncate_object_bytes', 'background_task', 'get_warn_once', + 'ordered_unique_list', ] # Base is used for all SQLAlchemy models. diff --git a/wrolpi/files/lib.py b/wrolpi/files/lib.py index 2ddcc7db..38a11b15 100644 --- a/wrolpi/files/lib.py +++ b/wrolpi/files/lib.py @@ -218,6 +218,7 @@ async def cancel_refresh_tasks(): def cancelable_wrapper(func: callable): """Wraps an async function so that it will be canceled by `cancel_refresh_tasks`.""" + @wraps(func) async def wrapped(*args, **kwargs): if PYTEST: