mirror of
https://github.com/jeffvli/feishin.git
synced 2024-11-20 14:37:06 +01:00
Move server directory outside of frontend src
This commit is contained in:
parent
863dce88b7
commit
0438f2d5f2
58
server/.eslintrc.js
Normal file
58
server/.eslintrc.js
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
module.exports = {
|
||||||
|
extends: ['plugin:typescript-sort-keys/recommended'],
|
||||||
|
ignorePatterns: [],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
parserOptions: {
|
||||||
|
createDefaultProgram: true,
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
project: './tsconfig.json',
|
||||||
|
sourceType: 'module',
|
||||||
|
},
|
||||||
|
plugins: ['@typescript-eslint', 'import', 'sort-keys-fix'],
|
||||||
|
root: true,
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||||
|
'@typescript-eslint/no-shadow': ['off'],
|
||||||
|
'import/no-cycle': 'error',
|
||||||
|
'import/no-extraneous-dependencies': 'off',
|
||||||
|
'import/no-unresolved': 'error',
|
||||||
|
'import/order': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
alphabetize: {
|
||||||
|
caseInsensitive: true,
|
||||||
|
order: 'asc',
|
||||||
|
},
|
||||||
|
groups: ['builtin', 'external', 'internal', ['parent', 'sibling']],
|
||||||
|
'newlines-between': 'never',
|
||||||
|
pathGroups: [
|
||||||
|
{
|
||||||
|
group: 'external',
|
||||||
|
pattern: 'react',
|
||||||
|
position: 'before',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'import/prefer-default-export': 'off',
|
||||||
|
'no-await-in-loop': 'off',
|
||||||
|
'no-console': 'off',
|
||||||
|
'no-nested-ternary': 'off',
|
||||||
|
'no-restricted-syntax': 'off',
|
||||||
|
'sort-keys-fix/sort-keys-fix': 'warn',
|
||||||
|
},
|
||||||
|
settings: {
|
||||||
|
'import/parsers': {
|
||||||
|
'@typescript-eslint/parser': ['.ts'],
|
||||||
|
},
|
||||||
|
'import/resolver': {
|
||||||
|
// See https://github.com/benmosher/eslint-plugin-import/issues/1396#issuecomment-575727774 for line below
|
||||||
|
node: {
|
||||||
|
extensions: ['.js', '.ts'],
|
||||||
|
paths: ['node_modules/', 'node_modules/@types'],
|
||||||
|
},
|
||||||
|
typescript: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
@ -33,7 +33,7 @@ const getSubsonicStreamUrl = (
|
|||||||
`?id=${remoteId}` +
|
`?id=${remoteId}` +
|
||||||
`&${token}` +
|
`&${token}` +
|
||||||
`&v=1.13.0` +
|
`&v=1.13.0` +
|
||||||
`&c=sonixd_${deviceId}`
|
`&c=Feishin_${deviceId}`
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ const getJellyfinStreamUrl = (
|
|||||||
`&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg` +
|
`&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg` +
|
||||||
`&transcodingContainer=ts` +
|
`&transcodingContainer=ts` +
|
||||||
`&transcodingProtocol=hls` +
|
`&transcodingProtocol=hls` +
|
||||||
`&deviceId=sonixd_${deviceId}` +
|
`&deviceId=Feishin_${deviceId}` +
|
||||||
`&playSessionId=${deviceId}` +
|
`&playSessionId=${deviceId}` +
|
||||||
`&api_key=${token}`
|
`&api_key=${token}`
|
||||||
);
|
);
|
||||||
@ -108,7 +108,7 @@ const imageUrl = (
|
|||||||
`?id=${imageId}` +
|
`?id=${imageId}` +
|
||||||
`&size=250` +
|
`&size=250` +
|
||||||
`&v=1.13.0` +
|
`&v=1.13.0` +
|
||||||
`&c=sonixd` +
|
`&c=Feishin` +
|
||||||
`&${token}`
|
`&${token}`
|
||||||
);
|
);
|
||||||
}
|
}
|
16856
server/package-lock.json
generated
Normal file
16856
server/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "sonixd-server",
|
"name": "feishin-server",
|
||||||
"version": "1.0.0-alpha1",
|
"version": "1.0.0-alpha1",
|
||||||
"description": "A full-featured Subsonic/Jellyfin compatible music player",
|
"description": "A full-featured Subsonic/Jellyfin compatible music player",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
@ -24,10 +24,11 @@
|
|||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "ts-node prisma/seed.ts"
|
"seed": "ts-node prisma/seed.ts"
|
||||||
},
|
},
|
||||||
"license": "ISC",
|
"license": "GPL-3.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/axios": "^0.14.0",
|
"@types/axios": "^0.14.0",
|
||||||
"@types/bcryptjs": "^2.4.2",
|
"@types/bcryptjs": "^2.4.2",
|
||||||
|
"@types/better-queue": "^3.8.3",
|
||||||
"@types/cookie-parser": "^1.4.3",
|
"@types/cookie-parser": "^1.4.3",
|
||||||
"@types/cors": "^2.8.12",
|
"@types/cors": "^2.8.12",
|
||||||
"@types/express": "^4.17.14",
|
"@types/express": "^4.17.14",
|
||||||
@ -37,7 +38,17 @@
|
|||||||
"@types/passport-jwt": "^3.0.7",
|
"@types/passport-jwt": "^3.0.7",
|
||||||
"@types/passport-local": "^1.0.34",
|
"@types/passport-local": "^1.0.34",
|
||||||
"@typescript-eslint/parser": "^5.40.0",
|
"@typescript-eslint/parser": "^5.40.0",
|
||||||
|
"eslint-config-airbnb": "^19.0.4",
|
||||||
|
"eslint-config-airbnb-base": "^15.0.0",
|
||||||
|
"eslint-config-erb": "^4.0.3",
|
||||||
|
"eslint-import-resolver-typescript": "^2.7.1",
|
||||||
|
"eslint-plugin-compat": "^4.0.2",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
|
"eslint-plugin-jest": "^27.1.3",
|
||||||
|
"eslint-plugin-n": "^15.3.0",
|
||||||
|
"eslint-plugin-promise": "^6.1.1",
|
||||||
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
||||||
|
"eslint-plugin-typescript-sort-keys": "^2.1.0",
|
||||||
"nodemon": "^2.0.20",
|
"nodemon": "^2.0.20",
|
||||||
"prisma": "^4.5.0",
|
"prisma": "^4.5.0",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
@ -47,7 +58,6 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^4.5.0",
|
"@prisma/client": "^4.5.0",
|
||||||
"@types/better-queue": "^3.8.3",
|
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"better-queue": "^3.8.12",
|
"better-queue": "^3.8.12",
|
@ -28,7 +28,7 @@ export const authenticate = async (options: {
|
|||||||
{ pw: password, username },
|
{ pw: password, username },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
'X-Emby-Authorization': `MediaBrowser Client="Sonixd", Device="PC", DeviceId="Sonixd", Version="1.0.0-alpha1"`,
|
'X-Emby-Authorization': `MediaBrowser Client="Feishin", Device="PC", DeviceId="Feishin", Version="1.0.0-alpha1"`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
@ -1,3 +1,4 @@
|
|||||||
|
import { prisma } from '@lib/prisma';
|
||||||
import {
|
import {
|
||||||
ExternalSource,
|
ExternalSource,
|
||||||
ExternalType,
|
ExternalType,
|
||||||
@ -7,7 +8,6 @@ import {
|
|||||||
ServerFolder,
|
ServerFolder,
|
||||||
} from '@prisma/client';
|
} from '@prisma/client';
|
||||||
import uniqBy from 'lodash/uniqBy';
|
import uniqBy from 'lodash/uniqBy';
|
||||||
import { prisma } from '@lib/prisma';
|
|
||||||
import { uniqueArray } from '../../utils/unique-array';
|
import { uniqueArray } from '../../utils/unique-array';
|
||||||
import {
|
import {
|
||||||
JFAlbum,
|
JFAlbum,
|
@ -1,7 +1,7 @@
|
|||||||
import { Server } from '@prisma/client';
|
import { Server } from '@prisma/client';
|
||||||
|
import { randomString } from '@utils/index';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import md5 from 'md5';
|
import md5 from 'md5';
|
||||||
import { randomString } from '@utils/index';
|
|
||||||
import {
|
import {
|
||||||
SSAlbumListEntry,
|
SSAlbumListEntry,
|
||||||
SSAlbumListResponse,
|
SSAlbumListResponse,
|
||||||
@ -47,7 +47,7 @@ const authenticate = async (options: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { data } = await api.get(
|
const { data } = await api.get(
|
||||||
`${cleanServerUrl}/rest/ping.view?v=1.13.0&c=sonixd&f=json&${token}`
|
`${cleanServerUrl}/rest/ping.view?v=1.13.0&c=Feishin&f=json&${token}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return { token, ...data };
|
return { token, ...data };
|
||||||
@ -55,7 +55,7 @@ const authenticate = async (options: {
|
|||||||
|
|
||||||
const getMusicFolders = async (server: Partial<Server>) => {
|
const getMusicFolders = async (server: Partial<Server>) => {
|
||||||
const { data } = await api.get<SSMusicFoldersResponse>(
|
const { data } = await api.get<SSMusicFoldersResponse>(
|
||||||
`${server.url}/rest/getMusicFolders.view?v=1.13.0&c=sonixd&f=json&${server.token}`
|
`${server.url}/rest/getMusicFolders.view?v=1.13.0&c=Feishin&f=json&${server.token}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return data.musicFolders.musicFolder;
|
return data.musicFolders.musicFolder;
|
||||||
@ -63,7 +63,7 @@ const getMusicFolders = async (server: Partial<Server>) => {
|
|||||||
|
|
||||||
const getArtists = async (server: Server, musicFolderId: string) => {
|
const getArtists = async (server: Server, musicFolderId: string) => {
|
||||||
const { data } = await api.get<SSArtistsResponse>(
|
const { data } = await api.get<SSArtistsResponse>(
|
||||||
`${server.url}/rest/getArtists.view?v=1.13.0&c=sonixd&f=json&${server.token}`,
|
`${server.url}/rest/getArtists.view?v=1.13.0&c=Feishin&f=json&${server.token}`,
|
||||||
{ params: { musicFolderId } }
|
{ params: { musicFolderId } }
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ const getArtists = async (server: Server, musicFolderId: string) => {
|
|||||||
|
|
||||||
const getGenres = async (server: Server) => {
|
const getGenres = async (server: Server) => {
|
||||||
const { data: genres } = await api.get<SSGenresResponse>(
|
const { data: genres } = await api.get<SSGenresResponse>(
|
||||||
`${server.url}/rest/getGenres.view?v=1.13.0&c=sonixd&f=json&${server.token}`
|
`${server.url}/rest/getGenres.view?v=1.13.0&c=Feishin&f=json&${server.token}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return genres;
|
return genres;
|
||||||
@ -84,7 +84,7 @@ const getGenres = async (server: Server) => {
|
|||||||
|
|
||||||
const getAlbum = async (server: Server, id: string) => {
|
const getAlbum = async (server: Server, id: string) => {
|
||||||
const { data: album } = await api.get<SSAlbumResponse>(
|
const { data: album } = await api.get<SSAlbumResponse>(
|
||||||
`${server.url}/rest/getAlbum.view?v=1.13.0&c=sonixd&f=json&${server.token}`,
|
`${server.url}/rest/getAlbum.view?v=1.13.0&c=Feishin&f=json&${server.token}`,
|
||||||
{ params: { id } }
|
{ params: { id } }
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ const getAlbums = async (
|
|||||||
) => {
|
) => {
|
||||||
const albums: any = api
|
const albums: any = api
|
||||||
.get<SSAlbumListResponse>(
|
.get<SSAlbumListResponse>(
|
||||||
`${server.url}/rest/getAlbumList2.view?v=1.13.0&c=sonixd&f=json&${server.token}`,
|
`${server.url}/rest/getAlbumList2.view?v=1.13.0&c=Feishin&f=json&${server.token}`,
|
||||||
{ params }
|
{ params }
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@ -131,7 +131,7 @@ const getAlbums = async (
|
|||||||
|
|
||||||
const getArtistInfo = async (server: Server, id: string) => {
|
const getArtistInfo = async (server: Server, id: string) => {
|
||||||
const { data: artistInfo } = await api.get<SSArtistInfoResponse>(
|
const { data: artistInfo } = await api.get<SSArtistInfoResponse>(
|
||||||
`${server.url}/rest/getArtistInfo2.view?v=1.13.0&c=sonixd&f=json&${server.token}`,
|
`${server.url}/rest/getArtistInfo2.view?v=1.13.0&c=Feishin&f=json&${server.token}`,
|
||||||
{ params: { id } }
|
{ params: { id } }
|
||||||
);
|
);
|
||||||
|
|
@ -1,8 +1,11 @@
|
|||||||
import express, { Router } from 'express';
|
import express, { Router } from 'express';
|
||||||
import { controller } from '@controllers/index';
|
import { controller } from '@controllers/index';
|
||||||
import { validation, validateRequest } from '@validations/index';
|
import { validateRequest, validation } from '@validations/index';
|
||||||
|
|
||||||
export const router: Router = express.Router({ mergeParams: true });
|
export const router: Router = express.Router({
|
||||||
|
mergeParams: true,
|
||||||
|
strict: true,
|
||||||
|
});
|
||||||
|
|
||||||
router.get('/', controller.albumArtists.getList);
|
router.get('/', controller.albumArtists.getList);
|
||||||
|
|
@ -12,7 +12,7 @@ require('./lib/passport');
|
|||||||
const PORT = 9321;
|
const PORT = 9321;
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const staticPath = path.join(__dirname, '../sonixd-client/');
|
const staticPath = path.join(__dirname, '../feishin-client/');
|
||||||
|
|
||||||
app.use(express.static(staticPath));
|
app.use(express.static(staticPath));
|
||||||
app.use(
|
app.use(
|
@ -31,7 +31,6 @@
|
|||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"rootDir": ".",
|
|
||||||
"typeRoots": ["./types"]
|
"typeRoots": ["./types"]
|
||||||
},
|
},
|
||||||
"exclude": ["dist"]
|
"exclude": ["dist"]
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user