wrolpi/app/src/components/Archive.js

1397 lines
48 KiB
JavaScript
Raw Normal View History

ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
import React, {useState} from "react";
import {useHotkeys} from "react-hotkeys-hook";
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
import {
APIButton,
BackButton,
CardLink,
DirectoryLink,
encodeMediaPath,
ErrorMessage,
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
ExternalCardLink,
FileIcon,
findPosterPath,
humanFileSize,
humanNumber,
InfoHeader,
isoDatetimeToAgoPopup,
PageContainer,
PreviewPath,
resolveDataPath,
SearchInput,
2022-01-29 22:25:35 -07:00
TabLinks,
2022-01-29 21:24:39 -07:00
textEllipsis,
mimetypeColor,
useTitle,
2022-01-29 21:24:39 -07:00
} from "./Common";
2025-12-06 14:49:46 -07:00
import {
deleteDomain,
2026-05-03 18:50:22 -06:00
deleteFileGroups,
fetchArchiveBrowsers,
fetchArchiveDownloaderConfig,
2025-12-06 14:49:46 -07:00
generateArchiveScreenshot,
getCollectionTagInfo,
postArchiveFileFormat,
2025-12-06 14:49:46 -07:00
postDownload,
previewBatchReorganization,
2025-12-06 14:49:46 -07:00
refreshDomain,
tagDomain,
tagFileGroup,
untagFileGroup,
updateArchiveDownloaderConfig,
2025-12-06 14:49:46 -07:00
} from "../api";
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
import {useForm} from "../hooks/useForm";
import {TaggedDeleteConfirmModal} from "./TaggedDeleteConfirmModal";
import {CollectionTagModal} from "./collections/CollectionTagModal";
import {CollectionReorganizeModal} from "./collections/CollectionReorganizeModal";
import {BatchReorganizeModal} from "./collections/BatchReorganizeModal";
import {useReorganizationStatus} from "../contexts/FileWorkerStatusContext";
import {Link, Route, Routes, useLocation, useNavigate, useParams} from "react-router";
import {
useArchive,
2026-02-02 15:15:28 -07:00
useArchiveStatistics,
useDockerized,
useDomain,
useDomains,
useOneQuery,
useSearchArchives,
useSearchDomain,
useSearchOrder
} from "../hooks/customHooks";
Search: fast ABC mode by default, opt-in deep search The file_group.textsearch tsvector indexes all four text columns; d_text (captions, document text, zip contents) is ~90% of the data, making ts_rank searches take seconds on large libraries. Add a textsearch_abc generated column (title/author/description only, ~8x smaller) and default all searches to it, with deep=true opting into the full column. Database: - Migration adds the generated column and a GIN index (rewrites the table; a few minutes on large libraries). Backend: - FilesSearchRequest, VideoSearchRequest, ArchiveSearchRequest, and DocSearchRequest accept `deep`; each search function picks the column. - /api/search_file_estimates returns both counts in one index-bound query (COUNT FILTER on the abc subset): `file_groups` (fast) and `file_groups_deep`. UI (one coherent story across the count surfaces): - The typing dropdown always suggests the deep count (what is findable). - The tab badge shows the active mode's count so it matches the result list. - The gap is reconciled by a hint offering deep search: count-aware on the global search ("No results in fast search. N results available in deep search." / "N more results available..."), generic on the module pages (no deep estimate there). The hint resets pagination. - "Search Depth" toggle in the search filter modals, persisted as ?deep=true. Tests that relied on d_text matches now pass deep=True, with fast-mode assertions alongside. Also skip flaky test_download_channel on CircleCI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:09:08 -06:00
import {DeepSearchHint, FileCards, FileRowTagIcon, FilesView, SearchControlBar} from "./Files";
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
import _ from "lodash";
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
import {
ActionInput,
Button,
Card,
Header,
Icon,
IconButton,
Loader,
Loading,
Message,
Panel,
Placeholder,
Select,
Statistic,
StatisticGroup,
Table,
Tabs,
Textarea,
TextInput,
Tooltip,
toast,
} from "./ui";
import {BulkTagModal} from "./BulkTagModal";
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
import {TagsSelector} from "../Tags";
Add ordered collections (playlists): polymorphic items + item API (#475) * Add Playlists: ordered, mixed-type collections A playlist (Collection kind='playlist') is a manually-curated, ordered list that mixes item types. Squash of the playlists feature branch (24 commits). Data model & API: - CollectionItem is polymorphic via item_kind: 'file' (FileGroup), 'zim' (zim_id + zim_entry), or 'url' (link to anything the WROLPi browser opens, e.g. /map?lat=&lon=&z=). CHECK constraint enforces exactly one kind; per-kind unique constraints; migration a7b1c2d3e4f5. - Endpoints: create playlist; add/remove/reorder items (idempotent adds: 201 new, 200 existing); GET returns the ordered items. All mutations wrol_mode_check'd. Config (source of truth): - playlists.yaml (PlaylistsConfig) stores each playlist's metadata AND ordered items (file by relative path, zim by path+entry, url inline); round-trips a DB wipe. Supports backup import (DB_CONFIG_FILE_NAMES). - The redundant generic CollectionsConfig (collections.yaml) is deleted: channels/domains own their configs, authors/subjects are re-derived. On-disk sync (sync_playlists_directory switch): - Each playlist materializes into the configurable Playlists Directory (playlists_destination, Settings UI input, excluded from indexing) with position-prefixed entries: NNNN_<file> hard links (copy fallback across filesystems) and NNNN_<title>.html stubs for zim/url items. - Tagged playlists are namespaced like channels: <playlists>/<tag>/<name>; a tag change moves the directory and prunes the empty old tag dir. - Deletion safety: managed files are only removed when they are our marked stubs or still have another hard link (st_nlink > 1) -- never a last copy. Stray loose files at the playlists root are removed; stub URLs are scheme-allowlisted (no javascript:/data:). Frontend: - /playlists list page (CollectionTable, name filter, New Playlist modal, Tag column) between Files and Zim in the nav. - View-only detail page (Name link) and edit page (Edit button): themed table with model icons/colors + poster thumbnails, items link to their model page (video/archive/doc) or preview, up/down reorder, remove, add-URL form, single-tag selector; all editing disabled in WROL Mode. - Reusable green "Add to Playlist" button on Video/Archive/Doc detail pages, the FilePreview toolbar, Zim search results, and Map pins (added as a /map URL item with a map-marker icon). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Playlist edit page parity: rename, custom directory, tag modal move suggestion Match the ChannelEditPage/DomainEditPage UX on the playlist edit page: Back/View buttons, an edit form (name, description, directory), and the shared CollectionTagModal with the violet "Tag" button. The tag modal now suggests moving the playlist to its managed tag location (playlists/<tag>/<name>); accepting the suggestion stores directory=None so the sync keeps auto-managing the location. Tag buttons on the Channel and Domain edit pages are now violet to match. Backend: update_collection learns rename (with per-kind validation and duplicate checks) and playlist custom directories (cleanup of the abandoned directory, config round-trip, commit-before-switch to avoid the background sync racing pre-commit state). tag_collection's duplicated untag/tag branches are merged, and the per-kind config-save dispatch is consolidated into _activate_config_save(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Deduplicate Collection error handling and Tag creation Delete the duplicate UnknownCollection in wrolpi/collections/errors.py and re-export the canonical one from wrolpi/errors.py, which carries status_code=NOT_FOUND (the local copy inherited 500). Replace the repeated query/raise pattern in reorganize.py with Collection.find_by_id. Add Tag.get_or_create_tag and use it for collection tagging; flush the new Tag before returning so callers can read .id immediately -- previously tagging a collection with a brand-new tag name set tag_id=None. Regression test included. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 19:37:34 -06:00
import {AddToPlaylistButton} from "./AddToPlaylist";
import {API_ARCHIVE_UPLOAD_URI, Downloaders} from "./Vars";
import {CollectionTable} from "./collections/CollectionTable";
import {CollectionEditForm} from "./collections/CollectionEditForm";
import {RecurringDownloadsTable} from "./admin/Downloads";
2025-12-05 18:26:36 -07:00
import {DestinationForm} from "./Download";
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
function ArchivePage() {
const navigate = useNavigate();
const {fileGroupId} = useParams();
const {archiveFile, history, fetchArchive} = useArchive(fileGroupId);
const [taggedFileGroups, setTaggedFileGroups] = useState(null);
let title = archiveFile ? archiveFile.title ? archiveFile.title : archiveFile.name : null;
useTitle(title);
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
if (archiveFile === null) {
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
return <Panel><Loading>Loading archive...</Loading></Panel>;
}
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
if (archiveFile === undefined) {
return <>
<Header as='h2'>Unknown archive</Header>
<Header as='h4'>This archive does not exist</Header>
</>
}
const {data, size, directory} = archiveFile;
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
// Resolve data paths (filename-only) to full relative paths using directory
const singlefilePath = resolveDataPath(data.singlefile_path, directory);
const readabilityPath = resolveDataPath(data.readability_path, directory);
const screenshotPath = resolveDataPath(data.screenshot_path, directory);
const singlefileUrl = singlefilePath ? `/media/${encodeMediaPath(singlefilePath)}` : null;
const readabilityUrl = readabilityPath ? `/media/${encodeMediaPath(readabilityPath)}` : null;
const screenshotUrl = screenshotPath ? `/media/${encodeMediaPath(screenshotPath)}` : null;
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
const singlefileButton = <ExternalCardLink to={singlefileUrl}>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Button color='violet'>View</Button>
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
</ExternalCardLink>;
2024-05-25 09:40:13 -06:00
const readButton = <ExternalCardLink to={readabilityUrl}>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Button color='blue' disabled={!!!readabilityUrl}>Read</Button>
2024-05-25 09:40:13 -06:00
</ExternalCardLink>
const screenshot = screenshotUrl ?
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<img alt='Archive screenshot' src={screenshotUrl}
style={{marginTop: '1em', marginBottom: '1em', maxWidth: '100%'}}/> :
null;
const localDeleteArchive = async (force = false) => {
2026-05-03 18:50:22 -06:00
const result = await deleteFileGroups([archiveFile.id], force);
if (result && result.tagged) {
setTaggedFileGroups(result.file_groups);
return;
}
toast({
type: 'success',
title: 'Archive Deleted',
description: 'Archive was successfully deleted.',
time: 2000,
})
navigate(-1);
}
2024-04-14 14:05:22 -06:00
const localUpdateArchive = async () => {
const downloadData = {urls: [archiveFile.url], downloader: Downloaders.Archive};
const response = await postDownload(downloadData);
if (response.ok) {
toast({
type: 'success',
title: 'Archive Downloading',
description: 'Archive update has been scheduled.',
time: 2000,
});
}
}
const localGenerateScreenshot = async () => {
const success = await generateArchiveScreenshot(archiveFile.id);
if (success) {
// Refresh the archive data after a short delay to show the new screenshot
setTimeout(() => fetchArchive(), 2000);
}
}
const updateButton = <APIButton
color='green'
confirmContent='Download the latest version of this URL?'
confirmButton='Update'
onClick={localUpdateArchive}
obeyWROLMode={true}
>
Update
</APIButton>;
const deleteButton = <APIButton
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
role='danger'
confirmContent='Are you sure you want to delete this archive? All files will be deleted'
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
confirmButton='Delete Archive'
onClick={() => localDeleteArchive(false)}
obeyWROLMode={true}
>
Delete
</APIButton>;
const generateScreenshotButton = !screenshotUrl ? <APIButton
color='yellow'
confirmContent='Generate a screenshot for this archive?'
confirmButton='Generate'
onClick={localGenerateScreenshot}
obeyWROLMode={true}
>
Generate Screenshot
</APIButton> : null;
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
let historyList = <Loader/>;
if (history && history.length === 0) {
historyList = <p>No history available</p>;
} else if (history) {
historyList = <FileCards files={history}/>;
}
const domain = data.domain ? data.domain : null;
let domainHeader = <p>Unknown</p>;
2022-10-27 11:30:53 -06:00
if (domain) {
const domainUrl = `/archives?domain=${domain}`;
domainHeader = <Header as='h4'>
<a href={domainUrl}>{domain}</a>
2022-10-27 11:30:53 -06:00
</Header>;
}
const localAddTag = async (name) => {
await tagFileGroup(archiveFile, name);
await fetchArchive();
}
const localRemoveTag = async (name) => {
await untagFileGroup(archiveFile, name);
await fetchArchive();
}
const downloadDatetimeString = archiveFile.download_datetime ?
isoDatetimeToAgoPopup(archiveFile.download_datetime, true) : 'unknown';
const publishedDatetimeString = archiveFile.published_datetime ?
isoDatetimeToAgoPopup(archiveFile.published_datetime, true) : 'unknown';
const modifiedDatetimeString = archiveFile.published_modified_datetime
? isoDatetimeToAgoPopup(archiveFile.published_modified_datetime, true)
: 'unknown';
// Helper to find file size from the files array by resolved path
const findFileSize = (resolvedPath) => {
if (!resolvedPath || !archiveFile.files) return null;
const file = archiveFile.files.find(i => String(i.path) === String(resolvedPath));
return file && file.size
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
? <span style={{marginLeft: '1em', color: 'var(--muted)'}}>({humanFileSize(file.size)})</span>
: null;
};
// Helper to resolve and preview a data path
const localPreviewPath = (dataPath, mimetype) => {
const resolvedPath = resolveDataPath(dataPath, directory);
if (resolvedPath) {
return <><PreviewPath path={resolvedPath} mimetype={mimetype}
taggable={false}>{resolvedPath}</PreviewPath>{findFileSize(resolvedPath)}</>
} else {
return 'Unknown'
}
}
const tableStyle = {width: '100%', borderCollapse: 'separate', borderSpacing: '0 0.7em'};
const labelStyle = {whiteSpace: 'nowrap', paddingRight: '1.5em', verticalAlign: 'top'};
2023-02-17 16:09:24 -07:00
return <>
<div className='wrolpi-button-row'><BackButton/></div>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Panel>
2023-02-17 16:09:24 -07:00
{screenshot}
<ExternalCardLink to={singlefileUrl}>
2023-04-06 11:05:14 -06:00
<Header as='h2'>{textEllipsis(archiveFile.title || data.url)}</Header>
2023-02-17 16:09:24 -07:00
</ExternalCardLink>
<Header as='h3'>Author: {archiveFile.author ? archiveFile.author : 'unknown'}</Header>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<div style={{display: 'flex', flexWrap: 'wrap', gap: '1em', marginBottom: '1em'}}>
<div style={{flex: '1 1 240px'}}>
<Header as='h4'>Published: {publishedDatetimeString}</Header>
</div>
<div style={{flex: '1 1 240px'}}>
<Header as='h4'>Downloaded: {downloadDatetimeString}</Header>
</div>
</div>
2023-02-17 16:09:24 -07:00
ui: a row of buttons is spaced by the row The archive page's six actions shared edges, and Update sat lower than the rest. Both come from the same thing: Semantic's Button carried `margin: 0 .25em .25em 0`, so a page could list buttons as bare siblings and they arrived spaced -- and separated from the line below when the row wrapped. Nothing replaced that margin. Two of those six answered with `marginTop: 0.5em`, which is the wrong axis: a Button is `display: inline-flex; vertical-align: middle`, and `vertical-align` is measured on the MARGIN box, so half of any top margin shows up as the visible button dropping. It was covering the wrapped-row case in the only axis a margin can, and paying for it in the other one. `.wrolpi-button-row` is a flex row with a gap, so both axes are covered at once and no button needs a margin of its own -- the same rule as `.wrolpi-stack`, along the other axis. Applied to the five rows in the app that had no gap: the archive page, the shared collection edit form (which three pages hand action buttons to, and where nine buttons plus Cancel carried `margin-top: 1em` each while Save carried none), the doc page's two responsive branches, and the downloads table's edit/restart pair. `.action-button-spacing` goes with them; it was that same margin, on Cancel. Guarded four ways. ui-layout.cy.js measures that the row really spaces what it holds, wraps rather than overflows, centres its buttons against a taller item beside them, and counts a confirmed APIButton as one item rather than two -- that one returns a fragment holding a `<Confirm/>`, which would open a hole in the row if it did not portal. Common.test.js scans for the two ways this comes back: a button in a row stamping a vertical margin, and a row of buttons that is not a row. Neither throws, which is how the app got here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 16:39:03 -06:00
<div className='wrolpi-button-row'>
{singlefileButton}
{readButton}
{updateButton}
{deleteButton}
{generateScreenshotButton}
<AddToPlaylistButton fileGroupId={archiveFile.id}/>
</div>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
</Panel>
2023-02-17 16:09:24 -07:00
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Panel>
<TagsSelector
selectedTagNames={archiveFile['tags']}
onAdd={localAddTag}
onRemove={localRemoveTag}
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
</Panel>
<Tabs defaultValue='about'>
<Tabs.List>
<Tabs.Tab value='about'>About</Tabs.Tab>
<Tabs.Tab value='files'>Files</Tabs.Tab>
</Tabs.List>
<Tabs.Panel value='about' pt='md'>
<Header as={'h3'}>Domain</Header>
{domainHeader}
<Header as='h3'>Size</Header>
{humanFileSize(size)}
<Header as={'h3'}>URL</Header>
<p>{archiveFile.url ? <a href={archiveFile.url}>{archiveFile.url}</a> : 'N/A'}</p>
<Header as={'h3'}>Modified Date</Header>
<p>{modifiedDatetimeString}</p>
</Tabs.Panel>
<Tabs.Panel value='files' pt='md'>
<table style={tableStyle}>
<tbody>
<tr>
<td style={labelStyle}><strong>Singlefile File</strong></td>
<td>{localPreviewPath(data.singlefile_path, 'text/html')}</td>
</tr>
<tr>
<td style={labelStyle}><strong>Readability File</strong></td>
<td>{localPreviewPath(data.readability_path, 'text/html')}</td>
</tr>
<tr>
<td style={labelStyle}><strong>Readability Text File</strong></td>
<td>{localPreviewPath(data.readability_txt_path, 'text/plain')}</td>
</tr>
<tr>
<td style={labelStyle}><strong>Readability JSON File</strong></td>
<td>{localPreviewPath(data.readability_json_path, 'application/json')}</td>
</tr>
<tr>
<td style={labelStyle}><strong>Screenshot File</strong></td>
<td>
{screenshotPath
? <><PreviewPath path={screenshotPath} mimetype='image/*'
taggable={false}>{screenshotPath}</PreviewPath>{findFileSize(screenshotPath)}</>
: 'Unknown'}
</td>
</tr>
<tr>
<td style={labelStyle}><strong>Directory</strong></td>
<td><DirectoryLink path={archiveFile.directory}/></td>
</tr>
</tbody>
</table>
</Tabs.Panel>
</Tabs>
<Panel>
<InfoHeader
2023-02-17 16:09:24 -07:00
headerContent='History'
popupContent='Other archives of this URL created at different times.'
/>
{historyList}
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
</Panel>
<TaggedDeleteConfirmModal
open={taggedFileGroups !== null}
taggedFileGroups={taggedFileGroups}
onCancel={() => setTaggedFileGroups(null)}
onConfirm={async () => {
setTaggedFileGroups(null);
await localDeleteArchive(true);
}}
/>
2023-02-17 16:09:24 -07:00
</>
}
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
export function ArchiveCard({file}) {
const {sort} = useSearchOrder();
const sortField = sort ? sort.replace(/^-/, '') : null;
const {data, directory} = file;
// Resolve data paths (filename-only) to full relative paths using directory
const screenshotPath = resolveDataPath(data.screenshot_path, directory);
const singlefilePath = resolveDataPath(data.singlefile_path, directory);
const imageSrc = screenshotPath ? `/media/${encodeMediaPath(screenshotPath)}` : null;
const singlefileUrl = singlefilePath ? `/media/${encodeMediaPath(singlefilePath)}` : null;
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
// Marks a tagged file, pinned to the poster's corner (same convention as CardPoster).
const cardTagIcon = <div className='wrolpi-card-tag'><Icon name='tag' size={14} label='Tagged'/></div>;
const imageLabel = !_.isEmpty(file.tags) ? cardTagIcon : null;
let media;
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
if (imageSrc) {
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
media = <ExternalCardLink to={singlefileUrl}>
<div style={{position: 'relative'}}>
{imageLabel}
<img alt='' src={imageSrc} style={{width: '100%', display: 'block'}}/>
</div>
</ExternalCardLink>;
} else {
media = <ExternalCardLink to={singlefileUrl}>
<div className='wrolpi-card-icon'>
{imageLabel}
<FileIcon file={file}/>
</div>
</ExternalCardLink>;
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
}
Making example label a tag. Tags can be created and deleted in UI. Adding tag_file using id to avoid session error. Using UTC in test. Matching tag_names style in test. Tag icon is displayed on file rows. Archives, Videos and Files can be filtered by their tags. Tags can be added and removed from UI. Tags are displayed in VideoPlayer. The tags of a file are returned in it's JSON. Video favorites are converted to Favorite tag on channel config import. Updating tests to match frontend usage. PDF creator and modification time are displayed. Reworking file search to use Video.__json__ for complex video relations. Archives can be viewed. Removing ebook.title. Reworking alembic migration to be an upgrade rather than a replace. Skipping test on circleci. Clearing out video caption index only if extract_subtitles if off. Channel tests pass. Some video tests pass. Missing videos can be found. A video can be downloaded. Orphaned files can be found. Videos can be tagged. Videos can be searched. Videos can be modeled. Converting some tests to use FileGroup.primary_path. Adding archive and domains to alembic migration. Testing cascading Archive titles. Archives now uses FileGroup. archive.lib tests pass. Archive is partially converted to FileGroup. Calculating FileGroup.primary file on refresh, rather than on select. wrolpi tests pass. Using FilesType to convert between str/pathlib.Path for FileGroup.files. Using list of files in FileGroup.files instead of dictionary. Storing files in dedicated FileGroup.files to avoid overwriting them. Adding comment explaining CASE. Not overwriting FileGroup.data on refresh if no change has been detected. Removing File model in favor of FileGroup.data. Adding typing to Files methods. Files are indexed using the primary mimetype of the FileGroup. files test_lib tests pass. Removing file_group_file in favor of simple one-to-many relationship. PDF files are indexed during refresh. Adding Tag and TagFile to tag files with specific tags. Only iterating when full_stem_ids has contents. Testing that FileGroups are related to their Files. Files and file_groups are created and linked. Bump webpack from 5.75.0 to 5.76.1 in /app (#160) Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.1) --- updated-dependencies: - dependency-name: webpack dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-24 08:58:18 -06:00
const domain = data ? data.domain : null;
const domainUrl = `/archives?domain=${domain}`;
const title = file.title || data.url;
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
const titleElm = <Tooltip label={title}>
<ExternalCardLink to={singlefileUrl} className='card-title-ellipsis'>{title}</ExternalCardLink>
</Tooltip>;
const dt = file.published_datetime || file.published_modified_datetime || file.modified;
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
const meta = <>
{domain && <div>
<CardLink to={domainUrl}>{domain}</CardLink>
</div>}
2023-02-17 16:09:24 -07:00
<div>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
{sortField === 'published_modified_datetime'
? isoDatetimeToAgoPopup(file.published_modified_datetime, false)
: sortField === 'download_datetime'
? isoDatetimeToAgoPopup(file.download_datetime, false)
: sortField === 'size'
? humanFileSize(file.size)
: sortField === 'viewed'
? isoDatetimeToAgoPopup(file.viewed, false)
: isoDatetimeToAgoPopup(dt, false)
}
</div>
</>;
ui: cards get legible titles, contained posters, and meta beside the title Four defects on /videos, /docs and /archives. Titles were invisible outside light. `.card-link` carried a literal `color: black` from before the themes existed -- about 1.1:1 on the dark, night and amber panels. It applies to every card title and to the channel/author/domain line beside it. The date was fine, since it takes `--muted` from the card body, which is what made this look like a card bug rather than a link bug. Titles now take `--text`: they are links, but they are the card's text, not a wall of blue. Posters were cropped, not mis-proportioned. The image carried a fixed 290x163 box; a card in the default grid is about 233px wide and Mantine's Card sets `overflow: hidden`, so the browser painted the middle 233px of a 290px image. The ratio was right in the layout tree and wrong on screen. Replaced with caps on both axes -- the card's width and `--card-poster-max-height: 200px` -- with `width`/`height` left `auto` so the pair behaves as "contain". Bounding the width alone was tried first and is not enough: a square thumbnail then stands as tall as the card is wide, and a portrait book cover taller still. The meta line was foot-anchored, so on /docs a PDF with no author had its date shoved up to 55px below the title, at the bottom of a card that was tall only because of its neighbour in the row. It now sits directly under the title. Archive cards read buttons-then-domain, because the buttons were children and the meta was what got pushed to the foot. Card gains an `actions` slot, rendered last and anchored to the foot, so a row lines its buttons up however many lines each title took. Gallery gains a poster row covering all five ratios and a row showing meta/actions against unequal titles. 1076 jest tests, 145 in ui-layout.cy.js, clean build. Every new guard was checked against a planted regression: dropping the height cap reddens the square and portrait cases and leaves 16:9 green; `width: 100%` reddens containment; restoring `color: black` reddens dark/night/amber and leaves light green; re-anchoring the meta and swapping the slot order redden both the jest order test and the cypress geometry tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-02 09:16:31 -06:00
const actions = <div style={{display: 'flex', gap: '0.5em'}}>
<Link to={`/archives/${file.id}`}>
<Button icon='file alternate'>Details</Button>
</Link>
<IconButton
icon='external'
label='Open original URL'
component='a'
href={file.url}
target='_blank'
rel='noopener noreferrer'
/>
</div>;
return <Card media={media} title={titleElm} meta={meta} actions={actions}
color={mimetypeColor(file.mimetype, file.primary_path)}/>
}
2025-12-05 17:12:21 -07:00
// Domain table column configuration
const DOMAIN_COLUMNS = [
{key: 'domain', label: 'Domain', sortable: true, width: 7},
{key: 'tag_name', label: 'Tag', sortable: true, width: 2},
{key: 'archive_count', label: 'Archives', sortable: true, align: 'right', width: 2},
2025-12-06 14:49:46 -07:00
{
key: 'min_download_frequency',
label: 'Download Frequency',
sortable: true,
format: 'frequency',
width: 2,
hideOnMobile: true
},
2025-12-05 17:12:21 -07:00
{key: 'size', label: 'Size', sortable: true, align: 'right', format: 'bytes', width: 2, hideOnMobile: true},
{key: 'actions', label: 'Manage', sortable: false, type: 'actions', width: 1}
];
const DOMAIN_ROUTES = {
list: '/archives/domains',
edit: '/archives/domain/:id/edit',
search: '/archives',
2025-12-05 17:12:21 -07:00
searchParam: 'domain'
};
function DomainStatistics({statistics}) {
if (!statistics) {
return <></>
}
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
return <Panel>
<Header as='h1'>Statistics</Header>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<StatisticGroup>
<Statistic value={statistics.archive_count} label='Archives'/>
<Statistic value={humanFileSize(statistics.size, true)} label='Total Size'/>
<Statistic value={humanFileSize(statistics.largest_archive, true)} label='Largest Archive'/>
<Statistic value={humanNumber(statistics.archive_tags)} label='Archive Tags'/>
</StatisticGroup>
</Panel>
}
export function DomainsPage() {
useTitle('Archive Domains');
2025-12-05 17:12:21 -07:00
const [domains] = useDomains();
const [searchStr, setSearchStr] = useOneQuery('domain');
const searchInputRef = React.useRef();
useHotkeys('f', (e) => {
e.preventDefault();
if (searchInputRef.current) {
searchInputRef.current.focus();
}
}, {enableOnFormTags: false});
ui: stop /archives/settings wrapping itself in a second PageContainer `ArchiveRoute` wraps its `<Routes>` in a PageContainer, and `ArchiveSettingsPage` wrapped itself in another. PageContainer carries `margin-top: 1em` and `padding: 1em`, so that page sat 1em lower and 1em further in on all four sides than /archives/domains beside it -- which is exactly what "seems to have more margin" was. It is a fragment now, so its panels are blocks of the route's own stack. Guarded by a source scan rather than a render, since a doubled margin throws nothing: it takes each PageContainer that wraps a router, reads the components it routes to, and fails if one of them renders a PageContainer of its own. The first version of that scan passed against the live bug. It looked at only the first `<PageContainer>` in a file, and in Archive.js that is the offender itself, whose block holds no `<Routes>` -- so the file was skipped before the route wrapper 400 lines below was reached. It reads every occurrence now, and the premise assertions count both the wrappers found and the routes within them. Two more top-level blocks gave up margins that were being added to the page's gap, both headers "matching" each other's pattern: the domain filter row (35.2px against 17.6px) and the channel filter row. /archives/settings and /archives/domains now measure identically -- tab bar bottom at 136.8px, first block 17.6px below it, content inset 17.6px -- as do the statistics and settings pages of every other tab group. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 15:53:04 -06:00
// Header section matching ChannelsPage pattern. No `marginBottom`: this is a top-level block
// of the page, and the page's stack spaces it -- its own margin was added to that gap.
const header = <div style={{display: 'flex', flexWrap: 'wrap', gap: '1em', alignItems: 'center'}}>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<div style={{flex: '1 1 240px'}}>
<SearchInput
placeholder='Domain filter...'
size='large'
searchStr={searchStr}
disabled={!Array.isArray(domains) || domains.length === 0}
onClear={() => setSearchStr('')}
onChange={setSearchStr}
onSubmit={null}
inputRef={searchInputRef}
/>
</div>
<div style={{flex: '1 1 240px', textAlign: 'right'}}>
{/* No "New Domain" button - domains are auto-created */}
</div>
</div>;
// Empty state
if (domains && domains.length === 0) {
return <>
{header}
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Message kind='info' title='No domains yet. Archive some webpages!'/>
</>;
}
// Error state
if (domains === undefined) {
return <>
{header}
<ErrorMessage>Could not fetch Domains</ErrorMessage>
</>;
}
return <>
{header}
<CollectionTable
collections={domains}
2025-12-05 17:12:21 -07:00
columns={DOMAIN_COLUMNS}
routes={DOMAIN_ROUTES}
searchStr={searchStr}
/>
</>;
}
export function DomainEditPage() {
const {domainId} = useParams();
const navigate = useNavigate();
const {domain, form, fetchDomain} = useDomain(parseInt(domainId));
// Modal state for tagging
const [tagEditModalOpen, setTagEditModalOpen] = useState(false);
// Modal state for reorganization
const [reorganizeModalOpen, setReorganizeModalOpen] = useState(false);
useTitle(`Edit Domain: ${domain?.domain || '...'}`);
// Wrap form.onSubmit to add toast and refresh domain data
React.useEffect(() => {
if (form && form.onSubmit) {
const originalOnSubmit = form.onSubmit;
form.onSubmit = async () => {
try {
await originalOnSubmit();
toast({
type: 'success',
title: 'Domain Updated',
description: 'Domain was successfully updated',
time: 3000,
});
// Refresh domain data to show updated values
await fetchDomain();
} catch (e) {
console.error('Failed to update domain:', e);
throw e;
}
};
}
}, [form, fetchDomain]);
// Handler for tag modal save
const handleTagSave = async (tagName, directory) => {
try {
await tagDomain(parseInt(domainId), tagName, directory);
toast({
type: 'success',
title: 'Domain Tagged',
description: `Domain "${domain?.domain}" has been tagged with "${tagName}"`,
time: 3000,
});
} catch (e) {
console.error('Failed to tag domain', e);
} finally {
setTimeout(async () => {
await fetchDomain();
}, 500);
}
};
// Handler for fetching tag info
const handleGetTagInfo = async (tagName) => {
if (domain?.id) {
return await getCollectionTagInfo(domain.id, tagName);
}
return null;
};
const handleRefreshDomain = async (e) => {
if (e) {
e.preventDefault();
}
await refreshDomain(parseInt(domainId));
// Refresh domain data after completion
await fetchDomain();
};
if (!form.ready) {
if (form.error) {
return <>
<div className='wrolpi-button-row'><BackButton/></div>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Message kind='error' title='Domain not found'>
<p>{form.error}</p>
</Message>
</>;
}
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
return <Loading>Loading domain...</Loading>;
}
// Handler for domain deletion
const handleDelete = async () => {
try {
let response = await deleteDomain(parseInt(domainId));
if (response.status === 204) {
navigate('/archives/domains');
}
} catch (e) {
console.error('Failed to delete domain', e);
}
};
const deleteButton = <APIButton
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
role='danger'
size='small'
confirmContent='Are you sure you want to delete this domain? No archive files will be deleted, but archives will be orphaned.'
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
confirmButton='Delete Domain'
confirmHeader='Delete Domain?'
onClick={handleDelete}
obeyWROLMode={true}
>Delete</APIButton>;
const refreshButton = domain?.directory ? (
<APIButton
color='blue'
size='small'
onClick={handleRefreshDomain}
obeyWROLMode={true}
>Refresh</APIButton>
) : null;
const tagButton = <Button
type="button"
size='small'
onClick={() => setTagEditModalOpen(true)}
Add ordered collections (playlists): polymorphic items + item API (#475) * Add Playlists: ordered, mixed-type collections A playlist (Collection kind='playlist') is a manually-curated, ordered list that mixes item types. Squash of the playlists feature branch (24 commits). Data model & API: - CollectionItem is polymorphic via item_kind: 'file' (FileGroup), 'zim' (zim_id + zim_entry), or 'url' (link to anything the WROLPi browser opens, e.g. /map?lat=&lon=&z=). CHECK constraint enforces exactly one kind; per-kind unique constraints; migration a7b1c2d3e4f5. - Endpoints: create playlist; add/remove/reorder items (idempotent adds: 201 new, 200 existing); GET returns the ordered items. All mutations wrol_mode_check'd. Config (source of truth): - playlists.yaml (PlaylistsConfig) stores each playlist's metadata AND ordered items (file by relative path, zim by path+entry, url inline); round-trips a DB wipe. Supports backup import (DB_CONFIG_FILE_NAMES). - The redundant generic CollectionsConfig (collections.yaml) is deleted: channels/domains own their configs, authors/subjects are re-derived. On-disk sync (sync_playlists_directory switch): - Each playlist materializes into the configurable Playlists Directory (playlists_destination, Settings UI input, excluded from indexing) with position-prefixed entries: NNNN_<file> hard links (copy fallback across filesystems) and NNNN_<title>.html stubs for zim/url items. - Tagged playlists are namespaced like channels: <playlists>/<tag>/<name>; a tag change moves the directory and prunes the empty old tag dir. - Deletion safety: managed files are only removed when they are our marked stubs or still have another hard link (st_nlink > 1) -- never a last copy. Stray loose files at the playlists root are removed; stub URLs are scheme-allowlisted (no javascript:/data:). Frontend: - /playlists list page (CollectionTable, name filter, New Playlist modal, Tag column) between Files and Zim in the nav. - View-only detail page (Name link) and edit page (Edit button): themed table with model icons/colors + poster thumbnails, items link to their model page (video/archive/doc) or preview, up/down reorder, remove, add-URL form, single-tag selector; all editing disabled in WROL Mode. - Reusable green "Add to Playlist" button on Video/Archive/Doc detail pages, the FilePreview toolbar, Zim search results, and Map pins (added as a /map URL item with a map-marker icon). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Playlist edit page parity: rename, custom directory, tag modal move suggestion Match the ChannelEditPage/DomainEditPage UX on the playlist edit page: Back/View buttons, an edit form (name, description, directory), and the shared CollectionTagModal with the violet "Tag" button. The tag modal now suggests moving the playlist to its managed tag location (playlists/<tag>/<name>); accepting the suggestion stores directory=None so the sync keeps auto-managing the location. Tag buttons on the Channel and Domain edit pages are now violet to match. Backend: update_collection learns rename (with per-kind validation and duplicate checks) and playlist custom directories (cleanup of the abandoned directory, config round-trip, commit-before-switch to avoid the background sync racing pre-commit state). tag_collection's duplicated untag/tag branches are merged, and the per-kind config-save dispatch is consolidated into _activate_config_save(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Deduplicate Collection error handling and Tag creation Delete the duplicate UnknownCollection in wrolpi/collections/errors.py and re-export the canonical one from wrolpi/errors.py, which carries status_code=NOT_FOUND (the local copy inherited 500). Replace the repeated query/raise pattern in reorganize.py with Collection.find_by_id. Add Tag.get_or_create_tag and use it for collection tagging; flush the new Tag before returning so callers can read .id immediately -- previously tagging a collection with a brand-new tag name set tag_id=None. Regression test included. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 19:37:34 -06:00
color='violet'
>Tag</Button>;
const reorganizeButton = (
<APIButton
color='orange'
size='small'
onClick={() => setReorganizeModalOpen(true)}
obeyWROLMode={true}
>Reorganize Files</APIButton>
);
const actionButtons = <>
{deleteButton}
{refreshButton}
{tagButton}
{reorganizeButton}
</>;
Fixing changes before merge. Moving FilesRefreshButton and DirectoryRefreshButton out of browser file. Moving file fetching tino FileBrowser. Removing sub-folders from Files display when any parent folder is clicked. Using closed captioning for vtt/srt file icon. Using my own react-semantic-toasts-2 to use toasts in Node 18. Fixing bug where more than the last page was displayed. Upgrading yt-dlp. Fixing sub-folder file selection. Adding rowKey to SortableTable to give React a key for each row. Renaming key to path. Removing duplicate urls. Unifying file modals. Displaying modals for image and text files. Handling refresh loading in FileBrowser. Creating refreshing_directory flag. Removing accidental commit. Sorting by url_count. Using SortableTable on Domains page. Using SortableTable for Channels page. Created new FileBrowser which allows browsing of files in the media directory. Using Node 18 in pi-gen. Creating new FileBrowser to replace outdated react-keyed-file-browser. Returning mimetype with file list. Do not display 'Do not download' on Channel download in Dashboard. Allowing null channel download frequency so user can stop downloading a channel. Bumping version for Node 18. Using my own semantic-ui-offline to avoid pulling Google fonts. Upgrading app docker container to use Node 18. This requires the removal of several npm packages. File browser will require re-write. It now pulls fonts from Google, this will need to be fixed. Testing DownloadsToggle click. Testing trinary states of DownloadsToggle. Installing @testing-library/user-event for testing App.
2023-01-31 18:08:07 -07:00
2025-12-05 18:26:36 -07:00
const [descriptionProps] = form.getCustomProps({name: 'description', path: 'description'});
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
return <>
<div className='wrolpi-button-row'>
<BackButton/>
<Link to={`/archives?domain=${domain?.domain}`}>
<Button>Archives</Button>
</Link>
</div>
{domain?.needs_reorganization && (
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Message kind='warning' title='File Format Changed'>
<p>
The file name format has changed. Click "Reorganize Files" to move existing files
to match the new format.
</p>
</Message>
)}
<CollectionEditForm
form={form}
title={`Edit Domain: ${domain?.domain || '...'}`}
wrolModeContent='Domain editing is disabled while in WROL Mode.'
actionButtons={actionButtons}
appliedTagName={domain?.tag_name}
2025-12-05 18:26:36 -07:00
>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
{/*
* CollectionEditForm still wraps its children in a `ui stackable grid` div (Semantic's
* grid CSS, not a component) because it is shared with unmigrated callers (Channels.js,
* Playlists.js). Plain "row"/"column" divs are that CSS's own class names, not a
* semantic-ui-react import.
*/}
<div className="row">
<div className="column">
2025-12-05 18:26:36 -07:00
<DestinationForm
form={form}
label='Directory'
name='directory'
path='directory'
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
</div>
</div>
<div className="row">
<div className="column">
<label style={{display: 'block', marginBottom: 4}}>Description</label>
<Textarea
placeholder='Optional description'
value={descriptionProps.value || ''}
onChange={(e) => descriptionProps.onChange(e.target.value)}
rows={3}
/>
</div>
</div>
2025-12-05 18:26:36 -07:00
</CollectionEditForm>
{/* Tag Modal */}
<CollectionTagModal
open={tagEditModalOpen}
onClose={() => setTagEditModalOpen(false)}
currentTagName={domain?.tag_name}
originalDirectory={domain?.directory}
getTagInfo={handleGetTagInfo}
onSave={handleTagSave}
collectionName="Domain"
hasDirectory={!!domain?.directory}
Fixing changes before merge. Moving FilesRefreshButton and DirectoryRefreshButton out of browser file. Moving file fetching tino FileBrowser. Removing sub-folders from Files display when any parent folder is clicked. Using closed captioning for vtt/srt file icon. Using my own react-semantic-toasts-2 to use toasts in Node 18. Fixing bug where more than the last page was displayed. Upgrading yt-dlp. Fixing sub-folder file selection. Adding rowKey to SortableTable to give React a key for each row. Renaming key to path. Removing duplicate urls. Unifying file modals. Displaying modals for image and text files. Handling refresh loading in FileBrowser. Creating refreshing_directory flag. Removing accidental commit. Sorting by url_count. Using SortableTable on Domains page. Using SortableTable for Channels page. Created new FileBrowser which allows browsing of files in the media directory. Using Node 18 in pi-gen. Creating new FileBrowser to replace outdated react-keyed-file-browser. Returning mimetype with file list. Do not display 'Do not download' on Channel download in Dashboard. Allowing null channel download frequency so user can stop downloading a channel. Bumping version for Node 18. Using my own semantic-ui-offline to avoid pulling Google fonts. Upgrading app docker container to use Node 18. This requires the removal of several npm packages. File browser will require re-write. It now pulls fonts from Google, this will need to be fixed. Testing DownloadsToggle click. Testing trinary states of DownloadsToggle. Installing @testing-library/user-event for testing App.
2023-01-31 18:08:07 -07:00
/>
{/* Reorganize Modal */}
<CollectionReorganizeModal
open={reorganizeModalOpen}
onClose={() => setReorganizeModalOpen(false)}
collectionId={domain?.id}
collectionName={domain?.domain}
onComplete={fetchDomain}
needsReorganization={domain?.needs_reorganization}
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
{/* Downloads Panel */}
<Panel>
<Header as='h1'>Downloads</Header>
<RecurringDownloadsTable
downloads={domain?.downloads}
fetchDownloads={fetchDomain}
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
</Panel>
{domain && domain.statistics && <DomainStatistics statistics={domain.statistics}/>}
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
</>;
}
function ArchiveFileNameForm({form}) {
const [message, setMessage] = React.useState(null);
const onChange = async (value) => {
const response = await postArchiveFileFormat(value);
const {error, preview} = await response.json();
if (error) {
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
setMessage({kind: 'error', title: 'Invalid File Name', content: error});
} else {
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
setMessage({kind: 'success', title: 'File Name Preview', content: preview});
}
}
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
const [inputProps] = form.getInputProps({name: 'file_name_format', path: 'file_name_format', onChange});
return <div>
<InfoHeader
headerSize='h5'
headerContent='Archive File Format'
popupContent={<>
<p>Variables:</p>
<ul>
<li><code>%(title)s</code> - Page title</li>
<li><code>%(download_datetime)s</code> - Full datetime (YYYY-MM-DD-HH-MM-SS)</li>
<li><code>%(download_date)s</code> - Date only (YYYY-MM-DD)</li>
<li><code>%(download_year)s</code> - Year</li>
<li><code>%(download_month)s</code> - Month (zero-padded)</li>
<li><code>%(download_day)s</code> - Day (zero-padded)</li>
<li><code>%(domain)s</code> - Domain name</li>
<li><code>%(ext)s</code> - File extension (required, must be at end)</li>
</ul>
<p>Subdirectories supported: <code>%(download_year)s/%(title)s.%(ext)s</code></p>
</>}
/>
<TextInput
id='file_name_format_input'
name='file_name_format'
value={inputProps.value ?? ''}
onChange={inputProps.onChange}
data-path={inputProps['data-path']}
/>
{message && <Message kind={message.kind} title={message.title}>{message.content}</Message>}
</div>
}
function BrowserConfigForm({form, browsers, browsersAvailable}) {
const [useCustomPath, setUseCustomPath] = useState(false);
// Determine if custom path is being used based on current value
React.useEffect(() => {
const currentBrowser = form.formData?.browser_executable;
if (currentBrowser) {
// Check if current value matches any known browser
const isKnownBrowser = browsers.some(b => b.path === currentBrowser || b.key === currentBrowser);
setUseCustomPath(!isKnownBrowser);
}
}, [form.formData?.browser_executable, browsers]);
if (!browsersAvailable) {
return null;
}
// Build dropdown options: auto-detect + installed browsers + custom
const browserOptions = [
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
{value: '', label: 'Auto-detect (recommended)'},
...browsers.map(b => ({value: b.path, label: `${b.name} (${b.path})`})),
{value: '__custom__', label: 'Custom path...'},
];
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
const handleBrowserChange = (value) => {
if (value === '__custom__') {
setUseCustomPath(true);
form.setValue('browser_executable', '');
} else {
setUseCustomPath(false);
form.setValue('browser_executable', value || null);
}
};
const currentValue = form.formData?.browser_executable || '';
const dropdownValue = useCustomPath ? '__custom__' : currentValue;
return <>
<Header as='h4'>Browser Settings</Header>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<p>
Configure which browser SingleFile uses to create archives.
These settings only apply to native deployments (Raspberry Pi/Debian).
</p>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<div style={{marginBottom: '1em'}}>
<label style={{display: 'block', marginBottom: 4}}>Browser</label>
<Select
data={browserOptions}
value={dropdownValue}
onChange={handleBrowserChange}
placeholder='Select browser...'
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
</div>
{useCustomPath && (
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<div style={{marginBottom: '1em'}}>
<label style={{display: 'block', marginBottom: 4}}>Custom Browser Path</label>
<TextInput
placeholder='/usr/bin/chromium'
value={form.formData?.browser_executable || ''}
onChange={(e) => form.setValue('browser_executable', e.target.value)}
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<small style={{color: 'var(--muted)'}}>Enter the absolute path to the browser executable.</small>
</div>
)}
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<div style={{marginBottom: '1em'}}>
<label style={{display: 'block', marginBottom: 4}}>Browser Arguments</label>
<TextInput
placeholder='["--no-sandbox"]'
value={form.formData?.browser_args || '["--no-sandbox"]'}
onChange={(e) => form.setValue('browser_args', e.target.value)}
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<small style={{color: 'var(--muted)'}}>JSON array of arguments passed to the browser. Default:
["--no-sandbox"]</small>
</div>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<div>
<label style={{display: 'block', marginBottom: 4}}>User Agent</label>
<TextInput
placeholder='Leave empty to use system default'
value={form.formData?.user_agent || ''}
onChange={(e) => form.setValue('user_agent', e.target.value || null)}
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<small style={{color: 'var(--muted)'}}>Custom user agent string. Leave empty to use the system
default.</small>
</div>
</>;
}
function ArchiveSettingsPage() {
useTitle('Archive Settings');
const dockerized = useDockerized();
const [batchModalOpen, setBatchModalOpen] = useState(false);
const [domainsNeedingReorg, setDomainsNeedingReorg] = useState(0);
const [fetchingReorgCount, setFetchingReorgCount] = useState(true);
const [browsers, setBrowsers] = useState([]);
const [browsersAvailable, setBrowsersAvailable] = useState(false);
// Check if batch reorganization is currently active for domains
const {isReorganizing, taskType, collectionKind} = useReorganizationStatus();
const isBatchReorganizingDomains = isReorganizing && taskType === 'batch_reorganize' && collectionKind === 'domain';
// Check how many domains need reorganization on mount (skip if batch is in progress)
React.useEffect(() => {
if (isBatchReorganizingDomains) {
// Skip fetching preview while batch reorganization is in progress
setFetchingReorgCount(false);
return;
}
setFetchingReorgCount(true);
previewBatchReorganization('domain')
.then(data => {
setDomainsNeedingReorg(data.total_collections || 0);
})
.catch(() => {
setDomainsNeedingReorg(0);
})
.finally(() => {
setFetchingReorgCount(false);
});
}, [isBatchReorganizingDomains]);
// Fetch available browsers on mount (only if not dockerized)
React.useEffect(() => {
if (dockerized === false) {
fetchArchiveBrowsers()
.then(data => {
setBrowsers(data.browsers || []);
setBrowsersAvailable(data.available === true);
})
.catch(() => {
setBrowsers([]);
setBrowsersAvailable(false);
});
}
}, [dockerized]);
const emptyFormData = {
file_name_format: '%(download_datetime)s_%(title)s.%(ext)s',
browser_executable: null,
browser_args: '["--no-sandbox"]',
user_agent: null,
};
const configSubmitter = async () => {
return await updateArchiveDownloaderConfig(configForm.formData);
};
const configForm = useForm({
fetcher: fetchArchiveDownloaderConfig,
submitter: configSubmitter,
emptyFormData,
});
const urlClipboardButton = <APIButton
icon='copy'
onClick={() => navigator.clipboard.writeText(API_ARCHIVE_UPLOAD_URI)}
/>;
const dataFieldNameClipboardButton = <APIButton
icon='copy'
onClick={() => navigator.clipboard.writeText('singlefile_contents')}
/>;
const urlFieldNameClipboardButton = <APIButton
icon='copy'
onClick={() => navigator.clipboard.writeText('url')}
/>;
ui: stop /archives/settings wrapping itself in a second PageContainer `ArchiveRoute` wraps its `<Routes>` in a PageContainer, and `ArchiveSettingsPage` wrapped itself in another. PageContainer carries `margin-top: 1em` and `padding: 1em`, so that page sat 1em lower and 1em further in on all four sides than /archives/domains beside it -- which is exactly what "seems to have more margin" was. It is a fragment now, so its panels are blocks of the route's own stack. Guarded by a source scan rather than a render, since a doubled margin throws nothing: it takes each PageContainer that wraps a router, reads the components it routes to, and fails if one of them renders a PageContainer of its own. The first version of that scan passed against the live bug. It looked at only the first `<PageContainer>` in a file, and in Archive.js that is the offender itself, whose block holds no `<Routes>` -- so the file was skipped before the route wrapper 400 lines below was reached. It reads every occurrence now, and the premise assertions count both the wrappers found and the routes within them. Two more top-level blocks gave up margins that were being added to the page's gap, both headers "matching" each other's pattern: the domain filter row (35.2px against 17.6px) and the channel filter row. /archives/settings and /archives/domains now measure identically -- tab bar bottom at 136.8px, first block 17.6px below it, content inset 17.6px -- as do the statistics and settings pages of every other tab group. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 15:53:04 -06:00
/*
* A fragment, not a `PageContainer`. `ArchiveRoute` already wraps its `<Routes>` in one, and
* a second applies its `margin-top: 1em` and `padding: 1em` again -- so this page sat 1em
* lower and 1em further in on all four sides than /archives/domains beside it. As a fragment
* these panels become blocks of the route's own page stack, which spaces them.
*/
return <>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Panel>
<Header as='h3'>Archive Downloader Config</Header>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<div style={{opacity: configForm.loading ? 0.6 : 1, pointerEvents: configForm.loading ? 'none' : 'auto'}}>
<div style={{maxWidth: 500, marginBottom: '1em'}}>
<ArchiveFileNameForm form={configForm}/>
</div>
{/* Browser settings - only shown on native deployments */}
{!dockerized && browsersAvailable && (
<div style={{maxWidth: 500, marginBottom: '1em'}}>
<BrowserConfigForm
form={configForm}
browsers={browsers}
browsersAvailable={browsersAvailable}
/>
</div>
)}
<div style={{textAlign: 'right'}}>
<APIButton
disabled={configForm.disabled || !configForm.ready}
type='submit'
style={{marginTop: '0.5em'}}
onClick={configForm.onSubmit}
id='archive_settings_save_button'
>Save</APIButton>
</div>
</div>
</Panel>
<Panel>
<Header as='h4'>File Organization</Header>
<p>
{fetchingReorgCount
? 'Checking for domains that need reorganization...'
: <>
<strong>{domainsNeedingReorg}</strong> domain{domainsNeedingReorg !== 1 ? 's' : ''}
{domainsNeedingReorg > 0
? ' have files that do not match the current file name format.'
: '. All domains are organized correctly.'}
</>
}
</p>
<Button
color='orange'
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
icon='folder open outline'
onClick={() => setBatchModalOpen(true)}
id='reorganize_all_domains_button'
disabled={fetchingReorgCount || domainsNeedingReorg === 0}
loading={fetchingReorgCount}
>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
Reorganize All Domains
</Button>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
</Panel>
<BatchReorganizeModal
open={batchModalOpen}
onClose={() => setBatchModalOpen(false)}
kind='domain'
onComplete={() => {
setBatchModalOpen(false);
setDomainsNeedingReorg(0);
}}
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Panel>
<Header as='h3'>SingleFile Browser Extension</Header>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<p>
These are the settings necessary to configure the <a
href="https://github.com/gildas-lormeau/SingleFile?tab=readme-ov-file#install"
rel='noopener noreferrer'
target='_blank'>SingleFile Browser
Extension</a> to automatically upload to your WROLPi.
</p>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<label style={{display: 'block', marginBottom: 4}}>Upload URL</label>
<ActionInput readOnly
value={API_ARCHIVE_UPLOAD_URI}
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
action={urlClipboardButton}
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<label style={{display: 'block', marginBottom: 4, marginTop: '1em'}}>Data Field Name</label>
<ActionInput readOnly
value='singlefile_contents'
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
action={dataFieldNameClipboardButton}
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<label style={{display: 'block', marginBottom: 4, marginTop: '1em'}}>URL Field Name</label>
<ActionInput readOnly
value='url'
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
action={urlFieldNameClipboardButton}
/>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
</Panel>
ui: stop /archives/settings wrapping itself in a second PageContainer `ArchiveRoute` wraps its `<Routes>` in a PageContainer, and `ArchiveSettingsPage` wrapped itself in another. PageContainer carries `margin-top: 1em` and `padding: 1em`, so that page sat 1em lower and 1em further in on all four sides than /archives/domains beside it -- which is exactly what "seems to have more margin" was. It is a fragment now, so its panels are blocks of the route's own stack. Guarded by a source scan rather than a render, since a doubled margin throws nothing: it takes each PageContainer that wraps a router, reads the components it routes to, and fails if one of them renders a PageContainer of its own. The first version of that scan passed against the live bug. It looked at only the first `<PageContainer>` in a file, and in Archive.js that is the offender itself, whose block holds no `<Routes>` -- so the file was skipped before the route wrapper 400 lines below was reached. It reads every occurrence now, and the premise assertions count both the wrappers found and the routes within them. Two more top-level blocks gave up margins that were being added to the page's gap, both headers "matching" each other's pattern: the domain filter row (35.2px against 17.6px) and the channel filter row. /archives/settings and /archives/domains now measure identically -- tab bar bottom at 136.8px, first block 17.6px below it, content inset 17.6px -- as do the statistics and settings pages of every other tab group. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 15:53:04 -06:00
</>
}
function ArchivesPage() {
const [selectedArchives, setSelectedArchives] = useState([]);
const [bulkTagOpen, setBulkTagOpen] = useState(false);
const [taggedFileGroups, setTaggedFileGroups] = useState(null);
const searchInputRef = React.useRef();
useHotkeys('f', (e) => {
e.preventDefault();
if (searchInputRef.current) {
searchInputRef.current.focus();
}
}, {enableOnFormTags: false});
const {domain, domains} = useSearchDomain();
// Find the domain object from the domains list to get the ID for the edit link
const domainObj = domain && domains ? domains.find(d => d.domain === domain) : null;
let title = 'Archives';
if (domainObj && domainObj.domain) {
title = `${domainObj.domain} Archives`;
}
useTitle(title);
const {
archives,
totalPages,
activePage,
setPage,
searchStr,
setSearchStr,
fetchArchives,
} = useSearchArchives();
let archiveOrders = [
{value: 'published_datetime', text: 'Published Date', short: 'P.Date'},
{value: 'published_modified_datetime', text: 'Modified Date', short: 'M.Date'},
{value: 'download_datetime', text: 'Download Date', short: 'D.Date'},
{value: 'size', text: 'Size'},
{value: 'viewed', text: 'Recently Viewed', short: 'R.Viewed'},
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
];
if (searchStr) {
archiveOrders = [{value: 'rank', text: 'Rank'}, ...archiveOrders];
}
const onSelect = (path, checked) => {
if (checked && path) {
setSelectedArchives([...selectedArchives, path]);
} else if (path) {
setSelectedArchives(selectedArchives.filter(i => i !== path));
}
}
2026-05-03 18:50:22 -06:00
const fileGroupIdsForSelection = () => archives
.filter(i => selectedArchives.indexOf(i['primary_path']) >= 0)
.map(i => i['id']);
const onDelete = async (force = false) => {
2026-05-03 18:50:22 -06:00
const fileGroupIds = fileGroupIdsForSelection();
const result = await deleteFileGroups(fileGroupIds, force);
if (result && result.tagged) {
setTaggedFileGroups(result.file_groups);
return;
}
await fetchArchives();
setSelectedArchives([]);
}
const invertSelection = async () => {
const newSelectedArchives = archives.map(archive => archive['key']).filter(i => selectedArchives.indexOf(i) < 0);
setSelectedArchives(newSelectedArchives);
}
const clearSelection = async (e) => {
if (e) e.preventDefault();
setSelectedArchives([]);
}
const onBulkTagComplete = async () => {
await fetchArchives();
setSelectedArchives([]);
}
const selectElm = <div className='wrolpi-button-row' style={{marginTop: '0.5em'}}>
<Button
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
role='primary'
disabled={_.isEmpty(selectedArchives)}
onClick={() => setBulkTagOpen(true)}
>Tag</Button>
<APIButton
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
role='danger'
disabled={_.isEmpty(selectedArchives)}
confirmButton='Delete'
confirmContent='Are you sure you want to delete these archives files? This cannot be undone.'
onClick={() => onDelete(false)}
>Delete</APIButton>
<Button
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
role='cancel'
onClick={invertSelection}
disabled={_.isEmpty(archives)}
>
Invert
</Button>
<Button
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
role='cancel'
onClick={clearSelection}
disabled={_.isEmpty(archives) || _.isEmpty(selectedArchives)}
>
Clear
</Button>
<BulkTagModal
open={bulkTagOpen}
onClose={() => setBulkTagOpen(false)}
paths={selectedArchives}
onComplete={onBulkTagComplete}
/>
</div>;
Consolidate search options into a single Filter modal (#497) * Consolidate search options into a single Filter modal Reworks the file-search UI on the Dashboard, Videos, Archives, and Docs pages. The crowded row of controls (sort, tags, limit, file-type filter, date selector) is replaced with a single "Filter" button that opens one comprehensive modal. - Add SearchFilterModal + SearchFilterButton (violet + count badge when active). Sections (Sort, File Type, Tags, Results Per Page, Published Date) are shown per-page via props; layout uses a Semantic Grid. - Selections are drafted locally and applied in a single updateQuery only on close/Done, so the search isn't re-run on every field change. - Results Per Page and Sort use buttons (fewer clicks, no clipped dropdown). - Extract shared SearchControlBar (view toggle + input + Filter) for the three results pages; move the global-search view toggle onto the tab row. - Rework the Dashboard search line into one adaptive flex row; clear button only shows when there's an active search. - Remove now-dead FilesView limit/tag returns and SearchLimitDropdown. * Address review: reset limit on Clear All; use replace over replaceAll - handleClearAll now resets Results Per Page to the default page size (DEFAULT_SEARCH_LIMIT = 24) so "Clear All" actually clears every setting. - Replace start-anchored replaceAll(/^-/g) with replace(/^-/) for the sort key. - Add a test covering the Clear All limit reset. * Remove now-unused Media import from Files.js The FilesSearchView refactor dropped the last <Media> usage in this file, leaving an unused import (a build warning). Remove it. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 19:49:15 -06:00
const {body, paginator, viewButton} = FilesView(
{
files: archives,
activePage: activePage,
totalPages: totalPages,
selectElem: selectElm,
selectedKeys: selectedArchives,
onSelect: onSelect,
setPage: setPage,
headlines: !!searchStr
},
);
// Domain header with edit link when filtering by domain
let header;
if (domainObj && domainObj.domain) {
const editLink = `/archives/domain/${domainObj.id}/edit`;
header = <>
<Header as='h1'>
{domainObj.domain}
<Link to={editLink}>
<Icon name='edit' style={{marginLeft: '0.5em'}}/>
</Link>
</Header>
</>;
} else if (domain) {
// Domain filter is set but domain object not loaded yet
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
header = <div style={{marginBottom: '1em'}}>
<Placeholder lines={1}/>
</div>;
}
return <>
{header}
Consolidate search options into a single Filter modal (#497) * Consolidate search options into a single Filter modal Reworks the file-search UI on the Dashboard, Videos, Archives, and Docs pages. The crowded row of controls (sort, tags, limit, file-type filter, date selector) is replaced with a single "Filter" button that opens one comprehensive modal. - Add SearchFilterModal + SearchFilterButton (violet + count badge when active). Sections (Sort, File Type, Tags, Results Per Page, Published Date) are shown per-page via props; layout uses a Semantic Grid. - Selections are drafted locally and applied in a single updateQuery only on close/Done, so the search isn't re-run on every field change. - Results Per Page and Sort use buttons (fewer clicks, no clipped dropdown). - Extract shared SearchControlBar (view toggle + input + Filter) for the three results pages; move the global-search view toggle onto the tab row. - Rework the Dashboard search line into one adaptive flex row; clear button only shows when there's an active search. - Remove now-dead FilesView limit/tag returns and SearchLimitDropdown. * Address review: reset limit on Clear All; use replace over replaceAll - handleClearAll now resets Results Per Page to the default page size (DEFAULT_SEARCH_LIMIT = 24) so "Clear All" actually clears every setting. - Replace start-anchored replaceAll(/^-/g) with replace(/^-/) for the sort key. - Add a test covering the Clear All limit reset. * Remove now-unused Media import from Files.js The FilesSearchView refactor dropped the last <Media> usage in this file, leaving an unused import (a build warning). Remove it. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 19:49:15 -06:00
<SearchControlBar
searchStr={searchStr}
setSearchStr={setSearchStr}
placeholder='Search Archives...'
inputRef={searchInputRef}
viewButton={viewButton}
sorts={archiveOrders}
Search: fast ABC mode by default, opt-in deep search The file_group.textsearch tsvector indexes all four text columns; d_text (captions, document text, zip contents) is ~90% of the data, making ts_rank searches take seconds on large libraries. Add a textsearch_abc generated column (title/author/description only, ~8x smaller) and default all searches to it, with deep=true opting into the full column. Database: - Migration adds the generated column and a GIN index (rewrites the table; a few minutes on large libraries). Backend: - FilesSearchRequest, VideoSearchRequest, ArchiveSearchRequest, and DocSearchRequest accept `deep`; each search function picks the column. - /api/search_file_estimates returns both counts in one index-bound query (COUNT FILTER on the abc subset): `file_groups` (fast) and `file_groups_deep`. UI (one coherent story across the count surfaces): - The typing dropdown always suggests the deep count (what is findable). - The tab badge shows the active mode's count so it matches the result list. - The gap is reconciled by a hint offering deep search: count-aware on the global search ("No results in fast search. N results available in deep search." / "N more results available..."), generic on the module pages (no deep estimate there). The hint resets pagination. - "Search Depth" toggle in the search filter modals, persisted as ?deep=true. Tests that relied on d_text matches now pass deep=True, with fast-mode assertions alongside. Also skip flaky test_download_channel on CircleCI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:09:08 -06:00
showDeep={true}
Consolidate search options into a single Filter modal (#497) * Consolidate search options into a single Filter modal Reworks the file-search UI on the Dashboard, Videos, Archives, and Docs pages. The crowded row of controls (sort, tags, limit, file-type filter, date selector) is replaced with a single "Filter" button that opens one comprehensive modal. - Add SearchFilterModal + SearchFilterButton (violet + count badge when active). Sections (Sort, File Type, Tags, Results Per Page, Published Date) are shown per-page via props; layout uses a Semantic Grid. - Selections are drafted locally and applied in a single updateQuery only on close/Done, so the search isn't re-run on every field change. - Results Per Page and Sort use buttons (fewer clicks, no clipped dropdown). - Extract shared SearchControlBar (view toggle + input + Filter) for the three results pages; move the global-search view toggle onto the tab row. - Rework the Dashboard search line into one adaptive flex row; clear button only shows when there's an active search. - Remove now-dead FilesView limit/tag returns and SearchLimitDropdown. * Address review: reset limit on Clear All; use replace over replaceAll - handleClearAll now resets Results Per Page to the default page size (DEFAULT_SEARCH_LIMIT = 24) so "Clear All" actually clears every setting. - Replace start-anchored replaceAll(/^-/g) with replace(/^-/) for the sort key. - Add a test covering the Clear All limit reset. * Remove now-unused Media import from Files.js The FilesSearchView refactor dropped the last <Media> usage in this file, leaving an unused import (a build warning). Remove it. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 19:49:15 -06:00
/>
{body}
Search: fast ABC mode by default, opt-in deep search The file_group.textsearch tsvector indexes all four text columns; d_text (captions, document text, zip contents) is ~90% of the data, making ts_rank searches take seconds on large libraries. Add a textsearch_abc generated column (title/author/description only, ~8x smaller) and default all searches to it, with deep=true opting into the full column. Database: - Migration adds the generated column and a GIN index (rewrites the table; a few minutes on large libraries). Backend: - FilesSearchRequest, VideoSearchRequest, ArchiveSearchRequest, and DocSearchRequest accept `deep`; each search function picks the column. - /api/search_file_estimates returns both counts in one index-bound query (COUNT FILTER on the abc subset): `file_groups` (fast) and `file_groups_deep`. UI (one coherent story across the count surfaces): - The typing dropdown always suggests the deep count (what is findable). - The tab badge shows the active mode's count so it matches the result list. - The gap is reconciled by a hint offering deep search: count-aware on the global search ("No results in fast search. N results available in deep search." / "N more results available..."), generic on the module pages (no deep estimate there). The hint resets pagination. - "Search Depth" toggle in the search filter modals, persisted as ?deep=true. Tests that relied on d_text matches now pass deep=True, with fast-mode assertions alongside. Also skip flaky test_download_channel on CircleCI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:09:08 -06:00
<DeepSearchHint searchStr={searchStr} files={archives}/>
{paginator}
<TaggedDeleteConfirmModal
open={taggedFileGroups !== null}
taggedFileGroups={taggedFileGroups}
onCancel={() => setTaggedFileGroups(null)}
onConfirm={async () => {
setTaggedFileGroups(null);
await onDelete(true);
}}
/>
</>
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
}
export function ArchiveRowCells({file}) {
Making example label a tag. Tags can be created and deleted in UI. Adding tag_file using id to avoid session error. Using UTC in test. Matching tag_names style in test. Tag icon is displayed on file rows. Archives, Videos and Files can be filtered by their tags. Tags can be added and removed from UI. Tags are displayed in VideoPlayer. The tags of a file are returned in it's JSON. Video favorites are converted to Favorite tag on channel config import. Updating tests to match frontend usage. PDF creator and modification time are displayed. Reworking file search to use Video.__json__ for complex video relations. Archives can be viewed. Removing ebook.title. Reworking alembic migration to be an upgrade rather than a replace. Skipping test on circleci. Clearing out video caption index only if extract_subtitles if off. Channel tests pass. Some video tests pass. Missing videos can be found. A video can be downloaded. Orphaned files can be found. Videos can be tagged. Videos can be searched. Videos can be modeled. Converting some tests to use FileGroup.primary_path. Adding archive and domains to alembic migration. Testing cascading Archive titles. Archives now uses FileGroup. archive.lib tests pass. Archive is partially converted to FileGroup. Calculating FileGroup.primary file on refresh, rather than on select. wrolpi tests pass. Using FilesType to convert between str/pathlib.Path for FileGroup.files. Using list of files in FileGroup.files instead of dictionary. Storing files in dedicated FileGroup.files to avoid overwriting them. Adding comment explaining CASE. Not overwriting FileGroup.data on refresh if no change has been detected. Removing File model in favor of FileGroup.data. Adding typing to Files methods. Files are indexed using the primary mimetype of the FileGroup. files test_lib tests pass. Removing file_group_file in favor of simple one-to-many relationship. PDF files are indexed during refresh. Adding Tag and TagFile to tag files with specific tags. Only iterating when full_stem_ids has contents. Testing that FileGroups are related to their Files. Files and file_groups are created and linked. Bump webpack from 5.75.0 to 5.76.1 in /app (#160) Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.1) --- updated-dependencies: - dependency-name: webpack dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-24 08:58:18 -06:00
const {data} = file;
let {sort} = useSearchOrder();
sort = sort ? sort.replace(/^-+/, '') : null;
const archiveUrl = `/archives/${file.id}`;
const posterPath = findPosterPath(file);
const posterUrl = posterPath ? `/media/${encodeMediaPath(posterPath)}` : null;
let poster;
if (posterUrl) {
poster = <CardLink to={archiveUrl}>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<img alt='' src={posterUrl} style={{width: '50px', height: 'auto'}}/>
</CardLink>;
} else {
poster = <FileIcon file={file} size='large'/>;
}
let dataCell = file.published_datetime ? isoDatetimeToAgoPopup(file.published_datetime) : '';
if (sort === 'published_modified_datetime') {
dataCell = file.published_modified_datetime ? isoDatetimeToAgoPopup(file.published_modified_datetime) : '';
} else if (sort === 'download_datetime') {
dataCell = file.download_datetime ? isoDatetimeToAgoPopup(file.download_datetime) : '';
} else if (sort === 'size') {
dataCell = humanFileSize(file.size);
} else if (sort === 'viewed') {
dataCell = isoDatetimeToAgoPopup(file.viewed);
}
// Fragment for SelectableRow
2023-02-17 16:09:24 -07:00
return <React.Fragment>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Table.Cell>
<div style={{textAlign: 'center'}}>
{poster}
</div>
</Table.Cell>
<Table.Cell>
<CardLink to={archiveUrl}>
Making example label a tag. Tags can be created and deleted in UI. Adding tag_file using id to avoid session error. Using UTC in test. Matching tag_names style in test. Tag icon is displayed on file rows. Archives, Videos and Files can be filtered by their tags. Tags can be added and removed from UI. Tags are displayed in VideoPlayer. The tags of a file are returned in it's JSON. Video favorites are converted to Favorite tag on channel config import. Updating tests to match frontend usage. PDF creator and modification time are displayed. Reworking file search to use Video.__json__ for complex video relations. Archives can be viewed. Removing ebook.title. Reworking alembic migration to be an upgrade rather than a replace. Skipping test on circleci. Clearing out video caption index only if extract_subtitles if off. Channel tests pass. Some video tests pass. Missing videos can be found. A video can be downloaded. Orphaned files can be found. Videos can be tagged. Videos can be searched. Videos can be modeled. Converting some tests to use FileGroup.primary_path. Adding archive and domains to alembic migration. Testing cascading Archive titles. Archives now uses FileGroup. archive.lib tests pass. Archive is partially converted to FileGroup. Calculating FileGroup.primary file on refresh, rather than on select. wrolpi tests pass. Using FilesType to convert between str/pathlib.Path for FileGroup.files. Using list of files in FileGroup.files instead of dictionary. Storing files in dedicated FileGroup.files to avoid overwriting them. Adding comment explaining CASE. Not overwriting FileGroup.data on refresh if no change has been detected. Removing File model in favor of FileGroup.data. Adding typing to Files methods. Files are indexed using the primary mimetype of the FileGroup. files test_lib tests pass. Removing file_group_file in favor of simple one-to-many relationship. PDF files are indexed during refresh. Adding Tag and TagFile to tag files with specific tags. Only iterating when full_stem_ids has contents. Testing that FileGroups are related to their Files. Files and file_groups are created and linked. Bump webpack from 5.75.0 to 5.76.1 in /app (#160) Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.1) --- updated-dependencies: - dependency-name: webpack dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-24 08:58:18 -06:00
<FileRowTagIcon file={file}/>
{textEllipsis(file.title || file.stem)}
</CardLink>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
</Table.Cell>
<Table.Cell>{dataCell}</Table.Cell>
2023-02-17 16:09:24 -07:00
</React.Fragment>
}
2026-02-02 15:15:28 -07:00
function ArchiveStatistics() {
useTitle('Archive Statistics');
const {statistics} = useArchiveStatistics();
if (statistics === null) {
// Request is pending.
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
return <Loading/>
2026-02-02 15:15:28 -07:00
} else if (statistics === undefined) {
return <ErrorMessage>Unable to fetch Archive Statistics</ErrorMessage>
}
const {archives, historical, domains} = statistics;
const archiveNames = [
{key: 'archives', label: 'Archives'},
{key: 'sum_size', label: 'Total Size'},
{key: 'max_size', label: 'Largest Archive'},
{key: 'week', label: 'Downloads Past Week'},
{key: 'month', label: 'Downloads Past Month'},
{key: 'year', label: 'Downloads Past Year'},
];
const historicalNames = [
{key: 'average_count', label: 'Average Monthly Downloads'},
{key: 'average_size', label: 'Average Monthly Usage'},
];
const domainNames = [
{key: 'domains', label: 'Domains'},
{key: 'tagged_domains', label: 'Tagged Domains'},
];
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
const buildPanel = (title, names, stats) => {
return <Panel>
<Header as='h1' style={{textAlign: 'center'}}>{title}</Header>
<StatisticGroup>
2026-02-02 15:15:28 -07:00
{names.map(
({key, label}) =>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
<Statistic key={key} value={stats[key]} label={label}/>
2026-02-02 15:15:28 -07:00
)}
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
</StatisticGroup>
</Panel>
2026-02-02 15:15:28 -07:00
}
return <>
ui: migrate Archive.js off Semantic UI React Replaces every semantic-ui-react and ./Theme import with the token-driven ./ui library: Segment->Panel, Tab/Tab.Pane->Tabs (Tabs.List/Tabs.Tab/ Tabs.Panel), Loader active inline='centered'->Loading, Message/Message.Header ->Message kind/title, Statistic/StatisticValue/StatisticLabel->Statistic value/label, Card/CardContent/CardHeader/CardMeta/CardDescription->Card media/title/meta/children, Input label={...}->ActionInput action={...}, Form.Dropdown->Select, Form/Form.Field/TextArea->plain markup + Textarea. Converts all three Semantic grid spellings (Grid.Row/Grid.Column, bare GridRow/GridColumn) to flexbox for the two-up rows in ArchivePage and DomainsPage, and to plain "row"/"column" divs (CollectionEditForm's existing CSS-class convention, shared with still-unmigrated Channels.js/Playlists.js) for the fields passed into CollectionEditForm in DomainEditPage. ArchiveFileNameForm no longer goes through hooks/useForm's InputForm helper, which still renders Semantic's Form.Input internally (hooks/useForm.js is off-limits for this migration) -- it now builds its field directly against form.getInputProps, mirroring the pattern Download.js already established. Drops ThemeContext's obsolete i/s/t/inverted spreads throughout, and the mimetype-color accent on Card (the new Card has no color prop; Videos.js's already-migrated VideoCard dropped the same accent for the same reason). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 13:13:06 -06:00
{buildPanel('Archives', archiveNames, archives)}
{buildPanel('Historical Archives', historicalNames, historical)}
{buildPanel('Domains', domainNames, domains)}
2026-02-02 15:15:28 -07:00
</>
}
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
export function ArchiveRoute() {
const location = useLocation();
const path = location.pathname;
2022-01-29 22:25:35 -07:00
const links = [
{
text: 'Archives',
to: '/archives',
end: true,
isActive: () => path === '/archives' || /^\/archives\/\d+$/.test(path)
},
{
text: 'Domains',
to: '/archives/domains',
isActive: () => path.startsWith('/archives/domain')
},
{text: 'Settings', to: '/archives/settings'},
{text: 'Statistics', to: '/archives/statistics'},
2022-01-29 21:24:39 -07:00
];
return <PageContainer>
2022-01-29 22:25:35 -07:00
<TabLinks links={links}/>
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
<Routes>
<Route path='/' element={<ArchivesPage/>}/>
<Route path='domains' element={<DomainsPage/>}/>
<Route path='domain/:domainId/edit' element={<DomainEditPage/>}/>
<Route path='settings' element={<ArchiveSettingsPage/>}/>
2026-02-02 15:15:28 -07:00
<Route path='statistics' element={<ArchiveStatistics/>}/>
<Route path=':fileGroupId' element={<ArchivePage/>}/>
Fixing JS warnings. Handling all combinations of toggle in light and dark. Changing CPUUsageProgress colors to be more readable in dark mode. Moving theme handling into Theme.js. Importing element wrappers from Theme.js to handle element theming. Changing video menu to dark mode. Creating ThemeContext to share Dark Mode setting. Removing duplicate code for search functions. Displaying X when downloads are disabled. Using react context to share settings across components. Refusing to start workers when WROL Mode is enabled. Changing warning to debug. Queuing recurring downloads first. Adding Video.url index. Adding special handling for youtube shorts to videos. Reworking Downloads to have one worker per process. Testing creating downloads and getting downloaders. Testing video validation and poster generation. Testing video statistics. Increasing inventory test coverage. Adding pytest.ini to automatically detect async test. Adding more archive test coverage. Testing Archive CRUD. Catching and logging when encountering error during indexing. Using FileIcon when Archive has no screenshot. A Video will be assigned to a Channel by its info json first, then to its directory. Including suffix in File json. Adding index for File.suffix. Gathering suffix during indexing. Passing entire file down to FileIcon. Moving logging up. Returning File.associated in file json. Associated files are last in file search. Removing duplicate refreshing code by creating new _refresh_directory function. Changing File.idempotency to a datetime to avoid having to clear idempotency. Truncating indexes to avoid error with large files. Don't overwrite video data when info json is empty. Using already_downloaded for channel videos. Awaiting refresh in Channel.refresh. Testing that videos already downloaded aren't downloaded again. Adding indexes for video/archive referenced paths. Changing grid width for mobile or computer. Adding button to refresh specific directories. Restoring Channel edit link. Fixing caption path in video_modeler. Adding ZIP files to mimetype colors. Using model instead of first file's model. Fetching File models in batches to avoid issuing a SELECT for every File with a model. Flushing generated poster file. Getting Channel in VideoPage, relying on Video.channl_id, falling back to URL's channel_id. Attaching Video to it's Channel during download. Using ExternalCardLink for ArchivePage singlefile link. Validating and indexing videos after download. Handling glob when file name contains matching characters. Reworking and testing split_path_stem_and_suffix and glob_shared_stem. Adding associated video files to DB during upsert. Adding pending downloads to dashboard. Hiding status when download is open. Handling when load is empty. Adding load statistics to Dashboard. Limiting concurrent after_refresh functions. Handling when no onSelect is declared. Adding ImageRow for FileTable. Moving image date into Card.Meta. Using ExternalLink for FileCard. Using ExternalLink for ImageCard. Handling when error occurs during refresh of a directory. Committing during refresh to avoid losing all files if an error occurs. Removing api health check to avoid spamming logs. Creating ImageCard to display image posters when they aren't too large. Removing archive.domain_id not null. Reworking file refresh to process all files in a single directory. Bumping version for major file rework. No longer checking for video corruption. Adding duration by default to speed up tests. Using register_indexer for all indexers. Adding CPU usage progress bar in Welcome. Modifying TextIndexer to ignore large text files. Counting all files during refresh. Adding refresh_logger to clarify logging. Checking for wrol_mode before refresh functions. Removing unused idempotency from video/channel tables. Using magic module to speed up mimetype identification. All tests pass. Archive tests pass. Changing video get endpoint to return 'file' to avoid ambiguity. Video tests pass. Simplifying regex filtering. Using regex to ignore case when filtering. Converting all channel classes to functions. Restoring channel refresh and download buttons. Matching format of Archive and Video pages. Adding sorting to Archives search. Reworking video orders for file search. Using SearchInput for videos search. Archives can be searched on the Archives page. Domains can be filtered. Reworking Archive search to use Files. Videos, Archives and Global search use the FilesView. Videos are claimed by their Channel based on the Channel's directory. Prev and Next video cards are displayed on the VideoPage. Creating useVideo for reworked VideoWrapper and VideoPage. Adding Paginator to FilesView. Moving file refresh button out of manage tab. Removing Files page tabs. Limiting refresh to one at a time. Adding class for card icon to match poster height. Video and Archives always re-claim their files on refresh. Archive files are indexed and claimed. FileView table is compact and striped. Videos page uses FileView. Updated navlinks to router v6. Removing ! character from file names. Disabling select button when cards are visible. Adding show/hide button for FileTable selection. The Archive Page is displayed. Adding mimetype dropdown. Upgrading to React Router v6 for useSearchParams. Validating video during modeling. Removing screenshot during corruption check because it was very slow. Updating app to use video files as search results. Updating video search to return Files. Video and WROLPi tests pass. Creating function to refresh files within a channel's directory. Removing troubleshooting print. Updating result order in test. Reworking video_factory to handle a specific video file location. Returning video model on file search. Getting session using video_file. Screenshotting when checking for video corruption. Reducing ffmpeg calls by gathering duration during poster generation. Moving video file matching into model. VideoIndexer is moved into video module. Video files are validated. Moving files module into wrolpi in preparation to use it in modules. Title and contents are indexed for text file. Files are indexed on refresh by using their indexer. Zip files are indexed using their contents. Testing multiple zip files. Adding unique to file.path. Checking that the correct indexer is used. Adding index to file.modification_datetime and file.size. Handling file info gathering in File.do_index. Only reading contents of file if file.indexed is False. Video model is found during file refresh. A Video record is created that has the associated files. Videos without associated files are found. Videos are found using registered video_modeler() rather than in refresh code. Removing old video columns. Handling video info json files. Trying to import each module individually. Will continue to import modules even if one fails. Reworking refresh so it performs less DB calls. Converting file.path to primary key. file.path is always a pathlib.Path. Updating video_factory to use new file system, testing it. Bump sanic from 21.9.1 to 21.12.2 in /docker/archive Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.1 to 21.12.2. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](https://github.com/sanic-org/sanic/compare/v21.9.1...v21.12.2) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
2022-08-06 05:22:07 +00:00
</Routes>
</PageContainer>
}