From a242dff9bb86882538c4c5d6291a0e5267d54c27 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 18 Mar 2026 15:34:27 +0100 Subject: I am perhaps too fast to push --- cogs/utils/file_search.py | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'cogs/utils') diff --git a/cogs/utils/file_search.py b/cogs/utils/file_search.py index 4a2bdc4..2685e25 100644 --- a/cogs/utils/file_search.py +++ b/cogs/utils/file_search.py @@ -3,53 +3,13 @@ # Copyright (C) 2026 Salmonik @ salmonik@tuta.io # https://codeberg.org/salmonik/senator-sperma -""" -Universal File Searcher - -This module provides a universal file searcher that can search for different file types: -- Audio files (mp3, wav, mp4, opus, m4a, flac, aac, ogg) -- Video files (mp4, avi, mkv, mov, wmv, flv, webm, m4v, 3gp) -- Image files (jpg, jpeg, png, gif, bmp, tiff, webp, svg, ico) - -Usage Examples: - # Search all file types - results = await UniversalSearcher.search_local("query") - - # Search only audio files - results = await UniversalSearcher.search_local("query", filetype="Audio") - - # Search only video files - results = await UniversalSearcher.search_local("query", filetype="Video") - - # Search only image files - results = await UniversalSearcher.search_local("query", filetype="Image") - - # Autocomplete search - results = await UniversalSearcher.search_local_autocomplete("partial_query", filetype="Video") - -Settings.json structure: -{ - "file_paths": [ - "/path/to/your/media/files", - "/another/path/with/mixed/content", - "relative/path/to/files" - ] -} - -Note: file_paths should contain directories that may contain any mix of audio, video, -and image files. The searcher will filter by file type automatically based on the -filetype parameter. -""" - import json import logging import re -import urllib.parse from pathlib import Path import aiofiles from rapidfuzz import fuzz import aiohttp -import asyncio import os from dotenv import load_dotenv @@ -405,7 +365,7 @@ class UniversalSearcher: try: baseurl = await UniversalSearcher._load_baseurl() - password = os.getenv("COPYPARTY_R_PASSWORD") + password = os.getenv("COPYPARTY_PASSWORD") async with aiohttp.ClientSession() as session: headers = {"Content-Type": "application/json"} -- cgit v1.2.3