import html
import json
import os
from typing import List
import scripts.mo.ui_format as ui_format
from scripts.mo.data.storage import map_record_to_dict
from scripts.mo.environment import env
from scripts.mo.models import Record, ModelType
from scripts.mo.utils import get_best_preview_url
_NO_PREVIEW_DARK = 'file=extensions/sd-model-organizer/pic/no-preview-dark-blue.png'
_NO_PREVIEW_LIGHT = 'file=extensions/sd-model-organizer/pic/no-preview-light.png'
def alert_danger(value) -> str:
if isinstance(value, list):
text = "
".join([html.escape(s) for s in value])
else:
text = html.escape(value)
return f'
Pending
' content += '' \ f'[{hint}]: {url}
' return content def _download_info(record_id, is_preview: bool) -> str: preview = '-preview' if is_preview else '' content = f'' return content def _download_progress_bar(record_id, is_preview: bool) -> str: preview = '-preview' if is_preview else '' content = '' return content def download_cards(records: List, token) -> str: content = f'