#!/bin/bash # Linux script to rebuild the Jellyfin solution properly # This script cleans and rebuilds in the correct order to resolve CS0006 metadata errors echo -e "\e[36mStarting Jellyfin solution rebuild...\e[0m" # Step 1: Clean the solution echo -e "\n\e[33m[1/3] Cleaning solution...\e[0m" dotnet clean Jellyfin.sln --configuration Debug # Remove obj and bin directories to ensure clean state echo -e "\n\e[33m[2/3] Removing build artifacts...\e[0m" find . -name bin -type d -exec rm -rf {} + find . -name obj -type d -exec rm -rf {} + # Step 3: Restore NuGet packages echo -e "\n\e[33m[3/3] Restoring NuGet packages...\e[0m" dotnet restore Jellyfin.sln # Step 4: Build the solution echo -e "\n\e[33m[4/4] Building solution...\e[0m" dotnet build Jellyfin.sln --configuration Debug --no-restore echo -e "\n\e[32mBuild complete!\e[0m" echo -e "\e[36mIf you still see errors, try building specific projects in this order:\e[0m" echo -e "\e[90m 1. Jellyfin.Database.Implementations\e[0m" echo -e "\e[90m 2. Jellyfin.Database.Providers.Postgres\e[0m" echo -e "\e[90m 3. Jellyfin.Server.Implementations\e[0m" echo -e "\e[90m 4. Emby.Server.Implementations\e[0m" echo -e "\e[90m 5. Jellyfin.Server\e[0m"