Compare commits
6 Commits
1a883193d0
...
01fad1b9d4
Author | SHA1 | Date | |
---|---|---|---|
01fad1b9d4 | |||
371bea79f9 | |||
35725e1320 | |||
d6a8c7d23f | |||
3c604e9593 | |||
43d8108270 |
@ -1,7 +1,8 @@
|
|||||||
FROM maven:3-openjdk-18 AS build
|
FROM maven:3-openjdk-23 AS build
|
||||||
|
|
||||||
COPY pom.xml /tmp/
|
COPY pom.xml /tmp/
|
||||||
COPY src /tmp/src/
|
COPY src /tmp/src/
|
||||||
|
COPY Formatter.xml /tmp/
|
||||||
WORKDIR /tmp/
|
WORKDIR /tmp/
|
||||||
RUN mvn clean compile assembly:single
|
RUN mvn clean compile assembly:single
|
||||||
|
|
||||||
|
90
back/pom.xml
90
back/pom.xml
@ -3,11 +3,11 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.kar</groupId>
|
<groupId>org.kar</groupId>
|
||||||
<artifactId>karusic</artifactId>
|
<artifactId>karusic</artifactId>
|
||||||
<version>1.0.5-SNAPSHOT</version>
|
<version>1.1.1-SNAPSHOT</version>
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.version>3.1</maven.compiler.version>
|
<maven.compiler.version>3.13.0</maven.compiler.version>
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
<maven.compiler.source>23</maven.compiler.source>
|
||||||
<maven.compiler.target>21</maven.compiler.target>
|
<maven.compiler.target>23</maven.compiler.target>
|
||||||
<maven.dependency.version>3.1.1</maven.dependency.version>
|
<maven.dependency.version>3.1.1</maven.dependency.version>
|
||||||
</properties>
|
</properties>
|
||||||
<repositories>
|
<repositories>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
<version>2.18.0-rc1</version>
|
<version>2.18.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--
|
<!--
|
||||||
************************************************************
|
************************************************************
|
||||||
@ -113,7 +113,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
<version>3.2.1</version>
|
<version>4.0.0-beta-1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>attach-sources</id>
|
<id>attach-sources</id>
|
||||||
@ -127,10 +127,12 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>3.0.0-M5</version>
|
<version>3.2.5</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<version>3.7.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
@ -142,81 +144,21 @@
|
|||||||
</descriptorRefs>
|
</descriptorRefs>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- Create coverage -->
|
|
||||||
<!--
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.jacoco</groupId>
|
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
|
||||||
<version>0.8.10</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>prepare-agent</id>
|
|
||||||
<goals>
|
|
||||||
<goal>prepare-agent</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>report</id>
|
|
||||||
<phase>test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>report</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>jacoco-check</id>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<rules>
|
|
||||||
<rule>
|
|
||||||
<element>PACKAGE</element>
|
|
||||||
<limits>
|
|
||||||
<limit>
|
|
||||||
<counter>LINE</counter>
|
|
||||||
<value>COVEREDRATIO</value>
|
|
||||||
<minimum>0.50</minimum>
|
|
||||||
</limit>
|
|
||||||
</limits>
|
|
||||||
</rule>
|
|
||||||
</rules>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
-->
|
|
||||||
<!-- Java-doc generation for stand-alone site -->
|
<!-- Java-doc generation for stand-alone site -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.2.0</version>
|
<version>3.3.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<show>private</show>
|
<show>private</show>
|
||||||
<nohelp>true</nohelp>
|
<nohelp>true</nohelp>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>exec-maven-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>exec-application</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>java</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<mainClass>org.kar.karusic.WebLauncher</mainClass>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<!-- Check the style of the code -->
|
<!-- Check the style of the code -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>net.revelc.code.formatter</groupId>
|
<groupId>net.revelc.code.formatter</groupId>
|
||||||
<artifactId>formatter-maven-plugin</artifactId>
|
<artifactId>formatter-maven-plugin</artifactId>
|
||||||
<version>2.23.0</version>
|
<version>2.24.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
<lineEnding>LF</lineEnding>
|
<lineEnding>LF</lineEnding>
|
||||||
@ -247,14 +189,6 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<includeFilterFile>spotbugs-security-include.xml</includeFilterFile>
|
<includeFilterFile>spotbugs-security-include.xml</includeFilterFile>
|
||||||
<excludeFilterFile>spotbugs-security-exclude.xml</excludeFilterFile>
|
<excludeFilterFile>spotbugs-security-exclude.xml</excludeFilterFile>
|
||||||
<!--<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>com.h3xstream.findsecbugs</groupId>
|
|
||||||
<artifactId>findsecbugs-plugin</artifactId>
|
|
||||||
<version>1.12.0</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
-->
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
@ -265,7 +199,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.2.0</version>
|
<version>3.3.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<show>public</show>
|
<show>public</show>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -18,8 +18,7 @@ public class Initialization extends MigrationSqlStep {
|
|||||||
private static final Logger LOGGER = LoggerFactory.getLogger(Initialization.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(Initialization.class);
|
||||||
|
|
||||||
public static final int KARSO_INITIALISATION_ID = 1;
|
public static final int KARSO_INITIALISATION_ID = 1;
|
||||||
public static final List<Class<?>> CLASSES_BASE = List.of(Album.class, Artist.class, Data.class, Gender.class,
|
public static final List<Class<?>> CLASSES_BASE = List.of(Album.class, Artist.class, Data.class, Gender.class, Playlist.class, Track.class, User.class);
|
||||||
Playlist.class, Track.class, User.class);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
10
front/pnpm-lock.yaml
generated
10
front/pnpm-lock.yaml
generated
@ -9,16 +9,16 @@ importers:
|
|||||||
.:
|
.:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@chakra-ui/anatomy':
|
'@chakra-ui/anatomy':
|
||||||
specifier: ^2.2.2
|
specifier: ~2.2.2
|
||||||
version: 2.3.4
|
version: 2.2.2
|
||||||
'@chakra-ui/cli':
|
'@chakra-ui/cli':
|
||||||
specifier: ^2.4.1
|
specifier: ~2.4.1
|
||||||
version: 2.4.1
|
version: 2.4.1
|
||||||
'@chakra-ui/react':
|
'@chakra-ui/react':
|
||||||
specifier: ^2.8.2
|
specifier: ~2.8.2
|
||||||
version: 2.8.2(@emotion/react@11.14.0(@types/react@18.3.8)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.8)(react@18.3.1))(@types/react@18.3.8)(react@18.3.1))(@types/react@18.3.8)(framer-motion@11.15.0(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
version: 2.8.2(@emotion/react@11.14.0(@types/react@18.3.8)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.8)(react@18.3.1))(@types/react@18.3.8)(react@18.3.1))(@types/react@18.3.8)(framer-motion@11.15.0(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||||
'@chakra-ui/theme-tools':
|
'@chakra-ui/theme-tools':
|
||||||
specifier: ^2.2.6
|
specifier: ~2.2.6
|
||||||
version: 2.2.6(@chakra-ui/styled-system@2.12.0(react@18.3.1))(react@18.3.1)
|
version: 2.2.6(@chakra-ui/styled-system@2.12.0(react@18.3.1))(react@18.3.1)
|
||||||
'@dnd-kit/core':
|
'@dnd-kit/core':
|
||||||
specifier: 6.3.1
|
specifier: 6.3.1
|
||||||
|
@ -25,9 +25,9 @@ const environment_back_prod: Environment = {
|
|||||||
karso: `${serverSSOAddress}/karso/api`,
|
karso: `${serverSSOAddress}/karso/api`,
|
||||||
},
|
},
|
||||||
ssoSite: `${serverSSOAddress}/karso/`,
|
ssoSite: `${serverSSOAddress}/karso/`,
|
||||||
ssoSignIn: `${serverSSOAddress}/karso/signin/karusic-dev/`,
|
ssoSignIn: `${serverSSOAddress}/karso/signin/karusic/`,
|
||||||
ssoSignUp: `${serverSSOAddress}/karso/signup/karusic-dev/`,
|
ssoSignUp: `${serverSSOAddress}/karso/signup/karusic/`,
|
||||||
ssoSignOut: `${serverSSOAddress}/karso/signout/karusic-dev/`,
|
ssoSignOut: `${serverSSOAddress}/karso/signout/karusic/`,
|
||||||
tokenStoredInPermanentStorage: false,
|
tokenStoredInPermanentStorage: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ const environment_local: Environment = {
|
|||||||
ssoSignUp: `${serverSSOAddress}/karso/signup/karusic-dev/`,
|
ssoSignUp: `${serverSSOAddress}/karso/signup/karusic-dev/`,
|
||||||
ssoSignOut: `${serverSSOAddress}/karso/signout/karusic-dev/`,
|
ssoSignOut: `${serverSSOAddress}/karso/signout/karusic-dev/`,
|
||||||
tokenStoredInPermanentStorage: false,
|
tokenStoredInPermanentStorage: false,
|
||||||
//replaceDataToRealServer: true,
|
replaceDataToRealServer: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const environment_full_local: Environment = {
|
const environment_full_local: Environment = {
|
||||||
|
@ -1,31 +1,69 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
|
||||||
import { Flex, Text, Wrap, WrapItem } from '@chakra-ui/react';
|
import { Button, Flex, Text, Tooltip, Wrap, WrapItem } from '@chakra-ui/react';
|
||||||
import { LuUser } from 'react-icons/lu';
|
import { LuUser } from 'react-icons/lu';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import { Artist } from '@/back-api';
|
import { Artist, Track } from '@/back-api';
|
||||||
import { Covers } from '@/components/Cover';
|
import { Covers } from '@/components/Cover';
|
||||||
import { EmptyEnd } from '@/components/EmptyEnd';
|
import { EmptyEnd } from '@/components/EmptyEnd';
|
||||||
import { PageLayout } from '@/components/Layout/PageLayout';
|
import { PageLayout } from '@/components/Layout/PageLayout';
|
||||||
import { SearchInput } from '@/components/SearchInput';
|
import { SearchInput } from '@/components/SearchInput';
|
||||||
import { TopBar } from '@/components/TopBar/TopBar';
|
import { BUTTON_TOP_BAR_PROPERTY, TopBar } from '@/components/TopBar/TopBar';
|
||||||
import { useArtistService, useOrderedArtists } from '@/service/Artist';
|
import { useArtistService, useOrderedArtists } from '@/service/Artist';
|
||||||
import { useThemeMode } from '@/utils/theme-tools';
|
import { useThemeMode } from '@/utils/theme-tools';
|
||||||
import { BASE_WRAP_HEIGHT, BASE_WRAP_ICON_SIZE, BASE_WRAP_SPACING, BASE_WRAP_WIDTH } from '@/constants/genericSpacing';
|
import { BASE_WRAP_HEIGHT, BASE_WRAP_ICON_SIZE, BASE_WRAP_SPACING, BASE_WRAP_WIDTH } from '@/constants/genericSpacing';
|
||||||
|
import { MdOutlineForkRight } from 'react-icons/md';
|
||||||
|
import { useActivePlaylistService } from '@/service/ActivePlaylist';
|
||||||
|
import { shuffleArray } from '@/utils/arrayTools';
|
||||||
|
import { useTrackService } from '@/service/Track';
|
||||||
|
import { DataTools, TypeCheck } from '@/utils/data-tools';
|
||||||
|
const LIMIT_RANDOM_VALUES = 25;
|
||||||
|
|
||||||
export const ArtistsPage = () => {
|
export const ArtistsPage = () => {
|
||||||
const { mode } = useThemeMode();
|
const { mode } = useThemeMode();
|
||||||
const [filterName, setFilterName] = useState<string | undefined>(undefined);
|
const [filterName, setFilterName] = useState<string | undefined>(undefined);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const { playInList } = useActivePlaylistService();
|
||||||
const onSelectItem = (data: Artist) => {
|
const onSelectItem = (data: Artist) => {
|
||||||
navigate(`/artist/${data.id}/`);
|
navigate(`/artist/${data.id}/`);
|
||||||
};
|
};
|
||||||
const { dataArtist } = useOrderedArtists(filterName);
|
const { dataArtist } = useOrderedArtists(filterName);
|
||||||
|
const { store: trackStore } = useTrackService();
|
||||||
|
const onRandomPlay = () => {
|
||||||
|
const data = shuffleArray(dataArtist)
|
||||||
|
const playingList: number[] = [];
|
||||||
|
for (let i = 0; i < Math.min(data.length, LIMIT_RANDOM_VALUES); i++) {
|
||||||
|
const selectedArtist: Artist = data[i];
|
||||||
|
const listArtistTracks: Track[] = DataTools.getsWhere(
|
||||||
|
trackStore.data,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
check: TypeCheck.CONTAINS,
|
||||||
|
key: 'artists',
|
||||||
|
value: selectedArtist.id,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
console.log(`[${selectedArtist.id}] Find Tracks: ${listArtistTracks}`);
|
||||||
|
if (listArtistTracks.length === 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
playingList.push(listArtistTracks[Math.floor(Math.random() * listArtistTracks.length)].id);
|
||||||
|
}
|
||||||
|
playInList(0, playingList)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TopBar title="All artists">
|
<TopBar title="All artists">
|
||||||
<SearchInput onChange={setFilterName} />
|
<SearchInput onChange={setFilterName} />
|
||||||
|
<Tooltip label="Random play">
|
||||||
|
<Button {...BUTTON_TOP_BAR_PROPERTY} onClick={onRandomPlay}>
|
||||||
|
<MdOutlineForkRight />
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
</TopBar>
|
</TopBar>
|
||||||
<PageLayout>
|
<PageLayout>
|
||||||
<Wrap spacing={BASE_WRAP_SPACING} marginX="auto" padding="20px" justify="center">
|
<Wrap spacing={BASE_WRAP_SPACING} marginX="auto" padding="20px" justify="center">
|
||||||
|
@ -11,3 +11,12 @@ export function arrayUnique(array: any[]) {
|
|||||||
|
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function shuffleArray<T>(array: T[]): T[] {
|
||||||
|
const out = [...array];
|
||||||
|
for (let i = out.length - 1; i > 0; i--) {
|
||||||
|
const j = Math.floor(Math.random() * (i + 1));
|
||||||
|
[out[i], out[j]] = [out[j], out[i]];
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
@ -1 +1 @@
|
|||||||
1.0.5-dev
|
1.1.1-dev
|
||||||
|
Loading…
x
Reference in New Issue
Block a user