Skip to content

Commit

Permalink
Merge pull request #55 from nini22P/dev
Browse files Browse the repository at this point in the history
feat: add local metadata cache
  • Loading branch information
nini22P authored Nov 26, 2023
2 parents d6f7b6c + 6cddff1 commit 9cd0661
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 300 deletions.
275 changes: 132 additions & 143 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "omp",
"description": "OneDrive Media Player",
"private": true,
"version": "1.2.4",
"version": "1.2.5",
"scripts": {
"dev": "webpack serve",
"build": "webpack --mode=production --node-env=production",
Expand All @@ -21,37 +21,38 @@
"extract-colors": "^4.0.2",
"i18next": "^23.7.6",
"i18next-browser-languagedetector": "^7.2.0",
"idb-keyval": "^6.2.1",
"music-metadata-browser": "^2.5.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^13.5.0",
"react-router-dom": "^6.19.0",
"react-router-dom": "^6.20.0",
"short-uuid": "^4.2.2",
"swr": "^2.2.4",
"zustand": "^4.4.6"
},
"devDependencies": {
"@swc/core": "^1.3.96",
"@swc/core": "^1.3.99",
"@types/extract-colors": "^1.1.4",
"@types/node": "^20.9.1",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"@types/node": "^20.10.0",
"@types/react": "^18.2.38",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"autoprefixer": "^10.4.16",
"compression-webpack-plugin": "^10.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.8.1",
"dotenv-webpack": "^8.0.1",
"eslint": "^8.53.0",
"eslint": "^8.54.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"html-webpack-plugin": "^5.5.3",
"postcss": "^8.4.31",
"postcss-loader": "^7.3.3",
"style-loader": "^3.3.3",
"swc-loader": "^0.2.3",
"typescript": "^5.2.2",
"typescript": "^5.3.2",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
Expand Down
142 changes: 6 additions & 136 deletions src/data/licenses.ts
Original file line number Diff line number Diff line change
@@ -1,249 +1,119 @@
export const licenses = [
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': '@azure/msal-browser',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/AzureAD/microsoft-authentication-library-for-js',
'remoteVersion': '2.38.1',
'installedVersion': '2.38.0',
'definedVersion': '^2.38.0',
'author': 'Microsoft nugetaad@microsoft.com https://www.microsoft.com'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': '@azure/msal-react',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/AzureAD/microsoft-authentication-library-for-js',
'remoteVersion': '1.5.10',
'installedVersion': '1.5.9',
'definedVersion': '^1.5.9',
'author': 'Microsoft nugetaad@microsoft.com https://www.microsoft.com'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': '@emotion/react',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/emotion-js/emotion#main',
'remoteVersion': '11.11.1',
'installedVersion': '11.11.1',
'definedVersion': '^11.11.1',
'author': 'Emotion Contributors'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': '@emotion/styled',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/emotion-js/emotion#main',
'remoteVersion': '11.11.0',
'installedVersion': '11.11.0',
'definedVersion': '^11.11.0',
'author': 'n/a'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': '@fontsource/roboto',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'Apache-2.0',
'link': 'https://github.com/fontsource/font-files',
'remoteVersion': '5.0.8',
'installedVersion': '5.0.5',
'definedVersion': '^5.0.5',
'author': 'Google Inc.'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': '@mui/icons-material',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/mui/material-ui',
'remoteVersion': '5.14.3',
'installedVersion': '5.14.3',
'definedVersion': '^5.14.3',
'author': 'MUI Team'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': '@mui/material',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/mui/material-ui',
'remoteVersion': '5.14.4',
'installedVersion': '5.14.3',
'definedVersion': '^5.14.3',
'author': 'MUI Team'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'buffer',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/feross/buffer',
'remoteVersion': '6.0.3',
'installedVersion': '6.0.3',
'definedVersion': '^6.0.3',
'author': 'Feross Aboukhadijeh feross@feross.org https://feross.org'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'extract-colors',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'GPL-3.0',
'link': 'https://github.com/Namide/extract-colors',
'remoteVersion': '3.0.0',
'installedVersion': '3.0.0',
'definedVersion': '^3.0.0',
'author': 'damien@doussaud.fr'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'i18next',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/i18next/i18next',
'remoteVersion': '23.4.4',
'installedVersion': '23.4.1',
'definedVersion': '^23.4.1',
'author': 'Jan Mühlemann <jan.muehlemann@gmail.com> (https://github.com/jamuhl)'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'i18next-browser-languagedetector',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/i18next/i18next-browser-languageDetector',
'remoteVersion': '7.1.0',
'installedVersion': '7.1.0',
'definedVersion': '^7.1.0',
'author': 'Jan Mühlemann <jan.muehlemann@gmail.com> (https://github.com/jamuhl)'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'idb-keyval',
'licenseType': 'Apache-2.0',
'link': 'https://github.com/jakearchibald/idb-keyval',
'author': 'Jake Archibald (https://github.com/jakearchibald)'
},
{
'name': 'music-metadata-browser',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/Borewit/music-metadata-browser',
'remoteVersion': '2.5.10',
'installedVersion': '2.5.10',
'definedVersion': '^2.5.10',
'author': 'Borewit https://github.com/Borewit'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'react',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/facebook/react',
'remoteVersion': '18.2.0',
'installedVersion': '18.2.0',
'definedVersion': '^18.2.0',
'author': 'n/a'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'react-dom',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/facebook/react',
'remoteVersion': '18.2.0',
'installedVersion': '18.2.0',
'definedVersion': '^18.2.0',
'author': 'n/a'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'react-i18next',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/i18next/react-i18next',
'remoteVersion': '13.1.2',
'installedVersion': '13.0.3',
'definedVersion': '^13.0.3',
'author': 'Jan Mühlemann <jan.muehlemann@gmail.com> (https://github.com/jamuhl)'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'react-router-dom',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/remix-run/react-router',
'remoteVersion': '6.15.0',
'installedVersion': '6.14.2',
'definedVersion': '^6.14.2',
'author': 'Remix Software <hello@remix.run>'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'short-uuid',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/oculus42/short-uuid',
'remoteVersion': '4.2.2',
'installedVersion': '4.2.2',
'definedVersion': '^4.2.2',
'author': 'Samuel Rouse'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'swr',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/vercel/swr',
'remoteVersion': '2.2.1',
'installedVersion': '2.2.0',
'definedVersion': '^2.2.0',
'author': 'n/a'
},
{
'department': 'kessler',
'relatedTo': 'stuff',
'name': 'zustand',
'licensePeriod': 'perpetual',
'material': 'material',
'licenseType': 'MIT',
'link': 'https://github.com/pmndrs/zustand',
'remoteVersion': '4.4.1',
'installedVersion': '4.4.0',
'definedVersion': '^4.4.0',
'author': 'Paul Henschel'
}
]
5 changes: 5 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"rename": "Rename",
"remove": "Remove",
"delete": "Delete",
"clear": "Clear",
"more": "More",
"about": "About",
"openSourceDependencies": "Open source dependencies"
Expand All @@ -28,5 +29,9 @@
"home": "Home",
"history": "History",
"setting": "Setting"
},
"data": {
"data": "Data",
"metaDataCache": "Local MetaData Cache"
}
}
5 changes: 5 additions & 0 deletions src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"rename": "重命名",
"remove": "移除",
"delete": "删除",
"clear": "清除",
"more": "更多",
"about": "关于",
"openSourceDependencies": "开源库"
Expand All @@ -28,5 +29,9 @@
"home": "主页",
"history": "历史",
"setting": "设置"
},
"data": {
"data": "数据",
"localMetaDataCache": "本地元数据缓存"
}
}
13 changes: 9 additions & 4 deletions src/pages/Player/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,16 @@ const Player = () => {
...test[0],
size: playQueue.filter(item => item.index === currentIndex)[0].fileSize
})
if (test[0].cover)
if (test[0].cover[0].data)
updateCover(URL.createObjectURL(new Blob([new Uint8Array(test[0].cover[0].data)], { type: 'image/png' })))
else
if (test[0].cover?.length) {
const cover = test[0].cover[0].data
if (cover && 'data' in cover && Array.isArray(cover.data)) {
updateCover(URL.createObjectURL(new Blob([new Uint8Array(cover.data as unknown as ArrayBufferLike)], { type: 'image/png' })))
} else if (cover) {
updateCover(URL.createObjectURL(new Blob([new Uint8Array(cover as ArrayBufferLike)], { type: 'image/png' })))
} else {
updateCover('./cover.png')
}
}
else
updateCover('./cover.png')
} else {
Expand Down
Loading

0 comments on commit 9cd0661

Please sign in to comment.