A comprehensive video library management system built with .NET, featuring both a command-line interface and a modern web application for organizing, tagging, and tracking your video collection.
- Video Management: Add, update, and organize videos with metadata
- Tagging System: Flexible tagging with categories (actors, composition, etc.)
- Watch Tracking: Track viewing history and statistics
- Search & Filter: Advanced filtering and listing capabilities
- Interactive Shell: Command-line interface with interactive mode
- Web Interface: Modern web UI for browsing and managing your collection
- Calendar View: Visualize your viewing patterns
- Plugin System: Extensible architecture for custom tag validation
- Multiple Storage Options: Support for filesystem and Dropbox storage
- Video Downloading: Integrated yt-dlp support for downloading videos
- Database Backed: PostgreSQL database for reliable data storage
- .NET 10.0 SDK or later
- PostgreSQL database server
- (Optional) yt-dlp for video downloading functionality
-
Clone the repository
git clone <repository-url> cd VideoGallery
-
Set up the database
Create a PostgreSQL database for the application.
-
Configure user secrets
Navigate to the CommandLine project directory:
cd src/CommandLineSet your connection string and storage configuration:
dotnet user-secrets set "ConnectionStrings:Db" "Host=localhost;Database=videogallery;Username=your_user;Password=your_password" dotnet user-secrets set "Storage:Folder" "/path/to/your/video/folder" dotnet user-secrets set "Storage:Type" "FileSystem"
-
Initialize the database
dotnet run --project src/CommandLine/CommandLine.csproj init
-
Build the solution
dotnet build src/VideoGallery.sln
The CLI tool (vd) provides several commands for managing your video library:
Interactive Shell Mode (default when run without arguments):
dotnet run --project src/CommandLine/CommandLine.csprojAvailable commands in shell mode:
list- List and filter videosdetails- Show detailed information about a videoopen- Open a video for viewingupdate- Update video metadatawatch- Mark a video as watchedunwatch- Remove watch history
Direct Command Execution:
# Add a new video
dotnet run --project src/CommandLine/CommandLine.csproj add
# List all videos
dotnet run --project src/CommandLine/CommandLine.csproj list
# Recalculate calculated tags
dotnet run --project src/CommandLine/CommandLine.csproj calctags
# View watch calendar
dotnet run --project src/CommandLine/CommandLine.csproj calendar
# Register a "no video" event
dotnet run --project src/CommandLine/CommandLine.csproj novideoRun the web application using the provided PowerShell script:
.\Run.ps1Or manually:
dotnet run --project src/WebSite/Website.csproj --launch-profile httpsThe web interface provides:
- Video grid with thumbnail view
- Detailed video information pages
- Advanced filtering and sorting
- Calendar view of watching activity
- Authentication support (OpenID Connect)
The application supports multiple storage backends:
- FileSystem: Store videos on local or network filesystem
- Dropbox: Store videos in Dropbox (requires additional configuration)
Configure via user secrets:
dotnet user-secrets set "Storage:Type" "FileSystem" # or "Dropbox"
dotnet user-secrets set "Storage:Folder" "/path/to/videos"The web application can be configured via appsettings.json, appsettings.Development.json, or appsettings.Production.json in the src/WebSite directory.
VideoGallery/
├── src/
│ ├── Abstractions/ # Core interfaces and abstractions
│ ├── Library/ # Core business logic and data models
│ │ ├── Infrastructure/ # Storage implementations (Dropbox, FileSystem)
│ │ ├── Migrations/ # Entity Framework migrations
│ │ └── Parsing/ # Query parsing logic
│ ├── CommandLine/ # CLI application
│ │ ├── Listing/ # List and filter commands
│ │ └── Utils/ # CLI utilities
│ ├── WebSite/ # ASP.NET Core web application
│ │ ├── Auth/ # Authentication configuration
│ │ ├── Calendar/ # Calendar view
│ │ ├── VideoDetail/ # Video detail pages
│ │ └── VideoGrid/ # Video grid view
│ └── Tests/ # Unit tests
├── Run.ps1 # Quick start script for web app
└── README.md # This file
- Framework: .NET 10.0
- Database: PostgreSQL with Entity Framework Core
- Web Framework: ASP.NET Core with Razor Pages
- CLI Framework: Custom shell with Spectre.Console
- Authentication: OpenID Connect
- Storage: FileSystem / Dropbox API
- Video Download: yt-dlp via CliWrap
- Testing: xUnit
- Npgsql.EntityFrameworkCore.PostgreSQL - PostgreSQL provider
- Spectre.Console - Beautiful console applications
- Dropbox.Api - Dropbox integration
- CliWrap - Process execution wrapper
- Microsoft.AspNetCore.Authentication.OpenIdConnect - Authentication
- Duende.AccessTokenManagement - Token management
dotnet test src/Tests/Tests.csprojcd src/Library
dotnet ef migrations add MigrationName --startup-project ../CommandLine/CommandLine.csprojThe application supports custom tag validation plugins. Create a class implementing ITagValidation and load it via the plugin system.
See [LICENSE.md]