From 2fc0cbacf56311947773e975bb4e32d8f562cec1 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 23 Jan 2022 19:32:08 +0700 Subject: [PATCH] update doc strings to represent new module structure --- tubearchivist/api/views.py | 2 +- tubearchivist/home/src/download/queue.py | 6 +++++- tubearchivist/home/src/download/subscriptions.py | 8 ++++++-- tubearchivist/home/src/download/thumbnails.py | 1 + tubearchivist/home/src/download/yt_dlp_handler.py | 8 +++++++- tubearchivist/home/src/es/connect.py | 6 +++++- tubearchivist/home/src/es/index_setup.py | 7 ++++++- tubearchivist/home/src/frontend/watched.py | 5 ++++- tubearchivist/home/src/index/channel.py | 6 +++++- tubearchivist/home/src/index/generic.py | 5 ++++- tubearchivist/home/src/index/playlist.py | 6 +++++- tubearchivist/home/src/index/reindex.py | 6 +++++- tubearchivist/home/src/index/video.py | 6 +++++- tubearchivist/home/src/ta/config.py | 1 - tubearchivist/home/src/ta/ta_redis.py | 6 +++++- tubearchivist/home/views.py | 2 +- 16 files changed, 65 insertions(+), 16 deletions(-) diff --git a/tubearchivist/api/views.py b/tubearchivist/api/views.py index c4bcb085..7ab8b47d 100644 --- a/tubearchivist/api/views.py +++ b/tubearchivist/api/views.py @@ -1,9 +1,9 @@ """all API views""" import requests +from home.src.download.thumbnails import ThumbManager from home.src.ta.config import AppConfig from home.src.ta.helper import UrlListParser -from home.src.download.thumbnails import ThumbManager from home.tasks import extrac_dl, subscribe_to from rest_framework.authentication import ( SessionAuthentication, diff --git a/tubearchivist/home/src/download/queue.py b/tubearchivist/home/src/download/queue.py index c8748e64..272c34d2 100644 --- a/tubearchivist/home/src/download/queue.py +++ b/tubearchivist/home/src/download/queue.py @@ -1,4 +1,8 @@ -"""handle download queue""" +""" +Functionality: +- handle download queue +- linked with ta_dowload index +""" import json import os diff --git a/tubearchivist/home/src/download/subscriptions.py b/tubearchivist/home/src/download/subscriptions.py index d6101373..2e4a29f3 100644 --- a/tubearchivist/home/src/download/subscriptions.py +++ b/tubearchivist/home/src/download/subscriptions.py @@ -1,7 +1,11 @@ -"""handle subscriptions""" +""" +Functionality: +- handle channel subscriptions +- handle playlist subscriptions +""" import yt_dlp -from home.src.download import queue # partial import +from home.src.download import queue # partial import from home.src.es.connect import IndexPaginate from home.src.index.channel import YoutubeChannel from home.src.index.playlist import YoutubePlaylist diff --git a/tubearchivist/home/src/download/thumbnails.py b/tubearchivist/home/src/download/thumbnails.py index 305bbd87..2ea8477c 100644 --- a/tubearchivist/home/src/download/thumbnails.py +++ b/tubearchivist/home/src/download/thumbnails.py @@ -1,6 +1,7 @@ """ functionality: - handle download and caching for thumbnails +- check for missing thumbnails """ import os diff --git a/tubearchivist/home/src/download/yt_dlp_handler.py b/tubearchivist/home/src/download/yt_dlp_handler.py index 80c8b868..671c5df7 100644 --- a/tubearchivist/home/src/download/yt_dlp_handler.py +++ b/tubearchivist/home/src/download/yt_dlp_handler.py @@ -1,4 +1,10 @@ -"""handle yt_dlp downloads""" +""" +functionality: +- handle yt_dlp +- build options and post processor +- download video files +- move to archive +""" import os import shutil diff --git a/tubearchivist/home/src/es/connect.py b/tubearchivist/home/src/es/connect.py index 7cf7d8cb..79fc0bde 100644 --- a/tubearchivist/home/src/es/connect.py +++ b/tubearchivist/home/src/es/connect.py @@ -1,4 +1,8 @@ -"""holds es connection manager""" +""" +functionality: +- wrapper around requests to call elastic search +- reusable search_after to extract total index +""" import json diff --git a/tubearchivist/home/src/es/index_setup.py b/tubearchivist/home/src/es/index_setup.py index 6b12a303..4bb980b1 100644 --- a/tubearchivist/home/src/es/index_setup.py +++ b/tubearchivist/home/src/es/index_setup.py @@ -1,4 +1,9 @@ -"""setup and verify needed elastic indexes""" +""" +functionality: +- setup elastic index at first start +- verify and update index mapping and settings if needed +- backup and restore metadata +""" import json import os diff --git a/tubearchivist/home/src/frontend/watched.py b/tubearchivist/home/src/frontend/watched.py index 0769232a..36ed0724 100644 --- a/tubearchivist/home/src/frontend/watched.py +++ b/tubearchivist/home/src/frontend/watched.py @@ -1,4 +1,7 @@ -"""handle watch state""" +""" +functionality: +- handle watched state for videos, channels and playlists +""" import json from datetime import datetime diff --git a/tubearchivist/home/src/index/channel.py b/tubearchivist/home/src/index/channel.py index a8b15256..50a0696b 100644 --- a/tubearchivist/home/src/index/channel.py +++ b/tubearchivist/home/src/index/channel.py @@ -1,4 +1,8 @@ -"""handle single channel in index""" +""" +functionality: +- get metadata from youtube for a channel +- index and update in es +""" import json import os diff --git a/tubearchivist/home/src/index/generic.py b/tubearchivist/home/src/index/generic.py index 6f88e377..af96abf8 100644 --- a/tubearchivist/home/src/index/generic.py +++ b/tubearchivist/home/src/index/generic.py @@ -1,4 +1,7 @@ -"""generic base class for indexing documents""" +""" +functionality: +- generic base class to inherit from for video, channel and playlist +""" import math diff --git a/tubearchivist/home/src/index/playlist.py b/tubearchivist/home/src/index/playlist.py index 2bd2d3a4..a9964a0a 100644 --- a/tubearchivist/home/src/index/playlist.py +++ b/tubearchivist/home/src/index/playlist.py @@ -1,4 +1,8 @@ -"""handle playlist""" +""" +functionality: +- get metadata from youtube for a playlist +- index and update in es +""" import json from datetime import datetime diff --git a/tubearchivist/home/src/index/reindex.py b/tubearchivist/home/src/index/reindex.py index b59d5a56..0eea2e3b 100644 --- a/tubearchivist/home/src/index/reindex.py +++ b/tubearchivist/home/src/index/reindex.py @@ -1,4 +1,8 @@ -"""periodically refresh documents""" +""" +functionality: +- periodically refresh documents +- index and update in es +""" import json from datetime import datetime diff --git a/tubearchivist/home/src/index/video.py b/tubearchivist/home/src/index/video.py index 7b71e36a..240a1b39 100644 --- a/tubearchivist/home/src/index/video.py +++ b/tubearchivist/home/src/index/video.py @@ -1,4 +1,8 @@ -"""handle single video index""" +""" +functionality: +- get metadata from youtube for a video +- index and update in es +""" import os from datetime import datetime diff --git a/tubearchivist/home/src/ta/config.py b/tubearchivist/home/src/ta/config.py index 569b2305..509e6511 100644 --- a/tubearchivist/home/src/ta/config.py +++ b/tubearchivist/home/src/ta/config.py @@ -2,7 +2,6 @@ Functionality: - read and write config - load config variables into redis -- needs to be a separate module to avoid circular import """ import json diff --git a/tubearchivist/home/src/ta/ta_redis.py b/tubearchivist/home/src/ta/ta_redis.py index 60b8e0e1..d131c96e 100644 --- a/tubearchivist/home/src/ta/ta_redis.py +++ b/tubearchivist/home/src/ta/ta_redis.py @@ -1,4 +1,8 @@ -"""interact with redis""" +""" +functionality: +- interact with redis +- hold temporary download queue in redis +""" import json import os diff --git a/tubearchivist/home/views.py b/tubearchivist/home/views.py index 006a9448..a0cac870 100644 --- a/tubearchivist/home/views.py +++ b/tubearchivist/home/views.py @@ -1,7 +1,7 @@ """ Functionality: - all views for home app -- process post data received from frontend via ajax +- holds base classes to inherit from """ import json