feat: add standalone Last.fm integration and settings management

- Implemented standalone Last.fm integration in the settings page.
- Added functionality to manage Last.fm credentials, including API key and secret.
- Introduced sidebar settings for toggling between expanded and collapsed views.
- Enhanced the Navidrome API with new methods for fetching starred items and album songs.
- Created a new Favorites page to display starred albums, songs, and artists with play and toggle favorite options.
- Added a Badge component for UI consistency across the application.
This commit is contained in:
2025-07-01 15:19:17 +00:00
committed by GitHub
parent 591faca2d3
commit f721213c4a
10 changed files with 1078 additions and 47 deletions

View File

@@ -15,8 +15,22 @@ const Ihateserverside: React.FC<IhateserversideProps> = ({ children }) => {
const [isSidebarVisible, setIsSidebarVisible] = useState(true);
const [isStatusBarVisible, setIsStatusBarVisible] = useState(true);
const [isSidebarHidden, setIsSidebarHidden] = useState(false);
const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(() => {
if (typeof window !== 'undefined') {
return localStorage.getItem('sidebar-collapsed') === 'true';
}
return false;
});
const { playlists } = useNavidrome();
const toggleSidebarCollapse = () => {
const newCollapsed = !isSidebarCollapsed;
setIsSidebarCollapsed(newCollapsed);
if (typeof window !== 'undefined') {
localStorage.setItem('sidebar-collapsed', newCollapsed.toString());
}
};
const handleTransitionEnd = () => {
if (!isSidebarVisible) {
setIsSidebarHidden(true); // This will fully hide the sidebar after transition
@@ -43,10 +57,12 @@ const Ihateserverside: React.FC<IhateserversideProps> = ({ children }) => {
{/* Main Content Area */}
<div className="flex-1 flex overflow-hidden">
{isSidebarVisible && (
<div className="w-64 flex-shrink-0 border-r">
<div className={`${isSidebarCollapsed ? 'w-16' : 'w-64'} flex-shrink-0 border-r transition-all duration-200`}>
<Sidebar
playlists={playlists}
className="h-full overflow-y-auto"
collapsed={isSidebarCollapsed}
onToggle={toggleSidebarCollapse}
onTransitionEnd={handleTransitionEnd}
/>
</div>