88 Commits
Author SHA1 Message Date
austinried 387d181073 repeat v1.1.2 changelog for google play 2022-04-01 10:22:23 +09:00
austinried b156e722b6 bump version for google play 2022-04-01 10:19:32 +09:00
austinried f256047b79 Release/v1.1.2 (#82)
* add changelog

* increment version
2022-03-28 16:16:48 +09:00
austinried 6fbb1aefc7 encode values before using in url (#81) 2022-03-28 15:44:58 +09:00
austinried 6a0e2c8be2 update build to main branch
add new ignores
2022-03-28 14:32:08 +09:00
dependabot[bot] 736c4b211b Bump ansi-regex from 4.1.0 to 4.1.1 (#80)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 14:21:17 +09:00
dependabot[bot] b7a9e6cd7a Bump minimist from 1.2.5 to 1.2.6 (#79)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 14:21:05 +09:00
dependabot[bot] bb9b82077c Bump plist from 3.0.4 to 3.0.5 (#78)
Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/TooTallNate/node-plist/releases)
- [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md)
- [Commits](https://github.com/TooTallNate/node-plist/commits)

---
updated-dependencies:
- dependency-name: plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 14:06:20 +09:00
austinried fed4a4b217 run validation before yarn license (#77)
* run validation before yarn license

* attempt to fix CI errors

https://github.com/yarnpkg/yarn/issues/7212
2022-03-28 14:05:49 +09:00
austinried 5d5188ae5b Library store refactor (#76)
* start of music store refactor

moving stuff into a state cache
better separate it from view logic

* added paginated list/album list

* reworked fetchAlbumList to remove ui state

refactored home screen to use new method
i broke playing songs somehow, JS thread goes into a loop

* don't reset parts manually, do it all at once

* fixed perf issue related to too many rerenders

rerenders were caused by strict equality check on object/array picks
switched artistInfo to new store
updated zustand and fixed deprecation warnings

* update typescript

and use workspace tsc version for vscode

* remove old artistInfo

* switched to new playlist w/songs

removed more unused stuff

* remove unused + (slightly) rework search

* refactor star

* use only original/large imges for covers/artist

fix view artist from context menu
add loading indicators to song list and artist views (show info we have right away)

* set starred/unstar assuming it works

and correct state on error

* reorg, remove old music slice files

* added back fix for song cover art

* sort artists by localCompare name

* update licenses

* fix now playing background grey bar

* update react-native-gesture-handler

for node-fetch security alert

* fix another gradient height grey bar issue

* update licenses again

* remove thumbnail cache

* rename to remove "Library" from methods

* Revert "remove thumbnail cache"

This reverts commit e0db4931f1.

* use ids for lists, pull state later

* Revert "use only original/large imges for covers/artist"

This reverts commit c9aea9065c.

* deep equal ListItem props for now

this needs a bigger refactor

* use immer as middleware

* refactor api client to use string method

hoping to use this for requestKey/deduping next

* use thumbnails in list items

* Revert "refactor api client to use string method"

This reverts commit 234326135b.

* rename/cleanup

* store servers by id

* get rid of settings selectors

* renames for clarity

remove unused estimateContentLength setting

* remove trackplayer selectors

* fix migration for library filter settings

* fixed shuffle order reporting wrong track/queue

* removed the other selectors

* don't actually need es6/react for our state

* fix slow artist sort on star

localeCompare is too slow for large lists
2022-03-28 13:30:57 +09:00
austinried b6e3a20e60 don't run prepare on yarn install... 2022-03-12 09:24:52 +09:00
austinried 97e442f306 add build instructions
add yarn script to prepare exoplayer/ffmpeg
2022-02-02 16:03:05 +09:00
austinried bc14fc9427 Upgrade React Native and deps (#68)
* upgrade RN to 0.67-rc.6
upgrade react-native-reanimated to 2.3.1
debug and release building/working

* update to RN stable 0.67

* yarn upgrade

also use xmldom builtin types

* ignore ndk dir for linting

* upgrade types (RN 0.67 not out yet)

* remove deprecated rule

* actually i like that one, keep for now

* update licenses

* upgrade RN types and use builtin dep

* upgrade RN 0.67.1
2022-01-23 13:36:02 +09:00
austinried 278ccdc471 fix boolean 2022-01-12 09:25:45 +09:00
Andrej Shadura d00eeed815 Fix autocorrect/autofill in server settings (#59) (#60)
Prevent autocorrection on URLs, disable autoCorrect and
autoCapitalise and set importantForAutofill.
2022-01-11 22:08:42 +09:00
austinried 7f098a2085 reduce api version to lowest currently needed (#53) 2021-12-18 09:50:16 +09:00
austinried 6b39d35e84 add .nvmrc for node 14.x 2021-12-15 14:38:15 +09:00
austinried 5a955e40cd changelog for 1.1.1 2021-12-15 14:08:37 +09:00
austinried bfc4b1f988 bump version 1.1.1 2021-12-15 14:05:51 +09:00
austinried c2f48db043 check if we paused on duck before playing again (#51)
prevents music playing after an alarm or call ends if it wasn't paused by that alarm/call in the first place
2021-12-15 13:59:58 +09:00
austinried f25f66fa41 Create FUNDING.yml 2021-12-13 09:34:22 +09:00
austinried 9a4357829b Release/v1.1.0 (#47)
* bump version for 1.1.0

* add changelog for 1.1.0
2021-12-06 11:05:18 +09:00
austinried 052e88fa5d Trust self-signed user certificates (#46)
* add network config to trust user certificates

* allow clear text traffic again
2021-12-06 10:16:06 +09:00
austinried c89a94b208 use .view method suffix for 1.14.0 (#45) 2021-12-06 10:05:59 +09:00
dependabot[bot] c0a93857ac Bump tmpl from 1.0.4 to 1.0.5 (#44)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-04 15:26:22 +09:00
Theo Salzmannandaustinried 0220e86883 FEATURE: add plain text password toggle to settings (#22)
* FEATURE: add plain text password toggle to settings

* clean up state types, lint, and add migrate

Co-authored-by: austinried <4966622+austinried@users.noreply.github.com>
2021-12-03 15:18:05 +09:00
austinried d1ac2df03a add f-droid badge to readme 2021-09-11 16:40:32 +09:00
austinried 3e6a20e0e3 use consistent user agent for requests 2021-09-08 15:49:01 +09:00
austinried ab575548fe stop saying my project is html pls 2021-09-08 10:13:54 +09:00
aux4 c11f3e41a7 Merge pull request #15 from austinried/exoplayer-extension
Build ExoPlayer ffmpeg extension for ALAC playback
2021-09-08 10:06:38 +09:00
austinried 995383df55 add ffmpeg license
reworked licenses into a single generated file
2021-09-08 09:32:35 +09:00
austinried 48a5cd454d too many files in here for watchman 2021-09-07 18:37:19 +09:00
austinried be0aaf2bc6 quiet down wget and unzip
really don't need 5mb of logs every time those run...
2021-09-07 18:32:22 +09:00
austinried a061a2d093 remove gradle wrapper that fails validation 2021-09-07 16:48:49 +09:00
austinried af67fb09a5 remove unused exoplayer modules
update licenses
2021-09-07 16:36:12 +09:00
austinried 2e3af7bed3 don't lint submodules 2021-09-07 15:44:18 +09:00
austinried 80adf0e249 Revert "regen lockfile"
This reverts commit c0c909dee1.
2021-09-07 15:38:52 +09:00
austinried c0c909dee1 regen lockfile 2021-09-07 15:35:10 +09:00
austinried 568bb7caba Merge branch 'master' into exoplayer-extension 2021-09-07 15:26:04 +09:00
austinried 85aaef4528 enable ffmpeg prep for GH builds 2021-09-07 15:23:57 +09:00
austinried d92890ce48 bump ram for release builds 2021-09-07 15:23:37 +09:00
austinried 9f22790412 build and use ffmpeg extension
pointing at my own repo for RNTP to enable extensions in exoplayer
new prepare script needs to be run to build ffmpeg
2021-09-07 14:40:22 +09:00
austinried 01753226e2 pull in/rely on exoplayer locally 2021-09-07 12:20:52 +09:00
aux4 21e0e74b64 Merge pull request #14 from austinried/dependabot/npm_and_yarn/immer-9.0.6
Bump immer from 9.0.5 to 9.0.6
2021-09-04 15:09:13 +09:00
dependabot[bot] 6bc98eeb54 Bump immer from 9.0.5 to 9.0.6
Bumps [immer](https://github.com/immerjs/immer) from 9.0.5 to 9.0.6.
- [Release notes](https://github.com/immerjs/immer/releases)
- [Commits](https://github.com/immerjs/immer/compare/v9.0.5...v9.0.6)

---
updated-dependencies:
- dependency-name: immer
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-04 05:46:58 +00:00
austinried 4f443d9c0e remove non-working cast button for now 2021-09-04 14:45:08 +09:00
austinried d83f2d227f add changelog for 1.0.1 2021-09-02 18:01:58 +09:00
austinried 810d1ee4b5 bump version 1.0.1 2021-09-02 17:23:38 +09:00
austinried 63931e640a remove unused permissions 2021-09-01 18:23:13 +09:00
austinried 3fd7a2112d fix text cutting off bottom w/fixed height 2021-09-01 15:11:24 +09:00
austinried 45bd5aa46e Merge branch 'master' of github.com:austinried/subtracks 2021-09-01 14:53:10 +09:00
aux4 0c117b3113 update readme coming soon 2021-09-01 10:17:38 +09:00
austinried c479e24dbf Merge branch 'master' of github.com:austinried/subtracks 2021-08-27 15:42:22 +09:00
aux4 2b2b7f749c update readme with google play link 2021-08-27 15:41:39 +09:00
austinried 122c686fec address xmldom security issue
https://github.com/advisories/GHSA-6fc8-4gx4-v693
2021-08-27 13:11:03 +09:00
austinried c864a03ece bump version 1.0.0 for release 2021-08-27 11:17:58 +09:00
austinried d7c34db155 add version number to about setion 2021-08-27 09:58:49 +09:00
austinried 32dd0ac0b4 update metadata per google play standards 2021-08-26 16:38:30 +09:00
austinried 30b05feca0 add metadata for stores 2021-08-26 16:10:49 +09:00
austinried eb0ccd00a3 bump sdk version for google play 2021-08-26 15:19:03 +09:00
austinried cc77935cd1 let's do some pre-release builds 2021-08-26 14:38:22 +09:00
austinried de8a484211 Merge branch 'master' of github.com:austinried/subtracks 2021-08-26 13:41:38 +09:00
aux4 49733ae1f1 update readme 2021-08-26 13:41:07 +09:00
austinried 9a8095d02d add scripts for bumping versions 2021-08-26 13:33:15 +09:00
austinried 409ee3bc86 ignore html for languages 2021-08-26 12:58:35 +09:00
austinried 24e6b1c306 remove bad button style 2021-08-26 12:49:26 +09:00
austinried 2c1dd06230 update header for better dark mode 2021-08-26 12:48:06 +09:00
austinried ad829ed93a added licenses and webview for them
added link to github page
2021-08-26 12:47:56 +09:00
austinried 0f1b8d6147 update readme 2021-08-26 08:18:29 +09:00
austinried 68b1a467f4 fix net state not being right on startup 2021-08-26 08:17:39 +09:00
austinried 3e3523baa8 lint builds 2021-08-26 08:07:32 +09:00
austinried 5055b0d9e8 fix for search clearing text/not scrolling 2021-08-25 16:32:04 +09:00
austinried d49c97c2b5 improved large album/playlist performance
switched to flatlist for all of those
2021-08-25 16:13:35 +09:00
austinried f3eac6102a readme update 2021-08-25 11:26:03 +09:00
austinried 92c58cedd9 settings wording 2021-08-25 10:43:36 +09:00
austinried 02d12fef49 remove UI option to disable estimateContentLength 2021-08-25 10:29:59 +09:00
austinried 2624831e1a Merge branch 'master' of github.com:austinried/subtracks 2021-08-25 10:25:03 +09:00
austinried 9576f6b4e7 fix player crashing at the end of transcoded track 2021-08-25 10:24:42 +09:00
aux4 5388f17347 specify android app in readme 2021-08-24 16:00:21 +09:00
austinried c436abc77d Merge branch 'master' of github.com:austinried/subtracks 2021-08-24 15:58:01 +09:00
austinried 06c533be48 stop building on non-app file changes 2021-08-24 15:57:46 +09:00
aux4 4606a21d46 added download badge to readme 2021-08-24 15:52:34 +09:00
austinried 72c25075a4 added "get it on" badges" 2021-08-24 15:49:41 +09:00
austinried 4bc46489cb better name/group artifacts 2021-08-24 15:31:22 +09:00
aux4 a87636c1fe fix readme link, add server examples 2021-08-24 14:46:07 +09:00
aux4 84bc814952 fix readme image formatting 2021-08-24 14:27:27 +09:00
austinried 3142fe7660 add images/features/coming soon to readme 2021-08-24 14:23:00 +09:00
aux4 1ad2e30627 Merge pull request #1 from austinried/github-actions-test
Use actions to build and sign PRs/releases
2021-08-24 11:27:12 +09:00
91 changed files with 2383 additions and 5563 deletions
-32
View File
@@ -1,32 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Smartphone (please complete the following information):**
- Device: [e.g. Pixel 4]
- OS: [e.g. Android 12]
- Subtracks version [e.g. 1.2.0]
**Additional context**
Add any other context about the problem here.
-20
View File
@@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
-17
View File
@@ -1,17 +0,0 @@
changelog:
exclude:
labels:
- ignore-for-release
- dependencies
authors:
- weblate
categories:
- title: New
labels:
- enhancement
- title: Fixed
labels:
- bug
- title: Other Changes
labels:
- "*"
@@ -17,7 +17,6 @@ on:
paths-ignore: paths-ignore:
- assets/** - assets/**
- .vscode/** - .vscode/**
- android/app/src/main/assets/custom/i18n/**
- .eslintrc.js - .eslintrc.js
- .prettierrc.js - .prettierrc.js
- BUILDING.md - BUILDING.md
+1
View File
@@ -0,0 +1 @@
2.7.4
+6
View File
@@ -0,0 +1,6 @@
source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.4'
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
+100
View File
@@ -0,0 +1,100 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
rexml
activesupport (6.1.4.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.11.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.11.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 1.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.2)
activesupport (>= 5.0, < 7)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.5.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.9)
escape (0.0.4)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.8.11)
concurrent-ruby (~> 1.0)
json (2.6.1)
minitest (5.15.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.6)
rexml (3.2.5)
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
xcodeproj (1.21.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.5.3)
PLATFORMS
ruby
DEPENDENCIES
cocoapods (~> 1.11, >= 1.11.2)
RUBY VERSION
ruby 2.7.4p191
BUNDLED WITH
2.2.27
-9
View File
@@ -3,8 +3,6 @@
# #
Subtracks is an Android open source music streaming app for [Subsonic-API-compatible](http://www.subsonic.org/pages/api.jsp) servers ([Subsonic](http://www.subsonic.org/pages/index.jsp), [Navidrome](https://www.navidrome.org/), [Airsonic](https://airsonic.github.io/), and more). It's designed to give you clean and convenient access to your music in the style of modern media players. Subtracks is an Android open source music streaming app for [Subsonic-API-compatible](http://www.subsonic.org/pages/api.jsp) servers ([Subsonic](http://www.subsonic.org/pages/index.jsp), [Navidrome](https://www.navidrome.org/), [Airsonic](https://airsonic.github.io/), and more). It's designed to give you clean and convenient access to your music in the style of modern media players.
[![Translation status](https://hosted.weblate.org/widgets/subtracks/-/subtracks/svg-badge.svg)](https://hosted.weblate.org/engage/subtracks/) ![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/austinried/subtracks/build-release-debugsign/main) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/austinried/subtracks?label=github) ![F-Droid](https://img.shields.io/f-droid/v/com.subtracks)
# Screenshots # Screenshots
<p float="left"> <p float="left">
<img src="metadata/en-US/images/phoneScreenshots/01_home.png" alt="home" width="200"/> <img src="metadata/en-US/images/phoneScreenshots/01_home.png" alt="home" width="200"/>
@@ -47,10 +45,3 @@ Subtracks is an Android open source music streaming app for [Subsonic-API-compat
# Building # Building
See [Building from source](BUILDING.md). See [Building from source](BUILDING.md).
# Translations
Want to see Subtracks in your language? Visit the project on [Weblate](https://hosted.weblate.org/engage/subtracks/) to help!
<a href="https://hosted.weblate.org/engage/subtracks/">
<img src="https://hosted.weblate.org/widgets/subtracks/-/subtracks/multi-auto.svg" alt="Translation status" />
</a>
+2 -2
View File
@@ -134,8 +134,8 @@ android {
applicationId "com.subtracks" applicationId "com.subtracks"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 9 versionCode 7
versionName '1.3.0' versionName '1.1.3'
} }
splits { splits {
abi { abi {
-1
View File
@@ -2,7 +2,6 @@
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission tools:node="remove" android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission tools:node="remove" android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission tools:node="remove" android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission tools:node="remove" android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission tools:node="remove" android:name="com.android.vending.CHECK_LICENSE"/>
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme" android:usesCleartextTraffic="true" android:networkSecurityConfig="@xml/network_security_config"> <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme" android:usesCleartextTraffic="true" android:networkSecurityConfig="@xml/network_security_config">
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustPan"> <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustPan">
<intent-filter> <intent-filter>
-152
View File
@@ -1,152 +0,0 @@
{
"resources": {
"album": {
"lists": {
"newest": "Afegit recentment",
"sort": "Ordenar els àlbums",
"random": "Aleatori",
"byGenre": "Per gènere",
"alphabeticalByName": "Pel nom",
"alphabeticalByArtist": "Per artista",
"byYear": "Per any",
"frequent": "Escoltat freqüentment",
"recent": "Reproduït recentment",
"starred": "Favorits"
},
"actions": {
"play": "Reproduir l'àlbum",
"view": "Veure l'àlbum"
},
"name": "Àlbum",
"name_plural": "Àlbums"
},
"artist": {
"lists": {
"sort": "Ordenar els artistes",
"starred": "Preferits",
"alphabeticalByName": "Pel nom",
"random": "Aleatori"
},
"name": "Artista",
"name_plural": "Artistes",
"actions": {
"view": "Veure l'artista"
}
},
"queue": {
"name": "Cua",
"name_plural": "Cues"
},
"song": {
"name": "Cançó",
"name_plural": "Cançons",
"lists": {
"artistTopSongs": "Millors cançons"
}
},
"playlist": {
"actions": {
"play": "Reproduir la llista de reproducció"
},
"name": "Playlist",
"name_plural": "Playlists"
}
},
"context": {
"actions": {
"unstar": "Eliminar dels preferits",
"star": "Afegir als favorits"
}
},
"navigation": {
"tabs": {
"home": "Inici",
"search": "Cercar",
"library": "Biblioteca",
"settings": "Paràmetres"
}
},
"messages": {
"nothingHere": "Aquí no hi ha res…"
},
"settings": {
"servers": {
"fields": {
"username": "Nom d’usuari",
"password": "Contrasenya",
"address": "Adreça"
},
"options": {
"forcePlaintextPassword": {
"title": "Forçar la contrasenya de text sense format",
"descriptionOn": "Enviar la contrasenya en text sense format (llegat, assegura't que la teva connexió sigui segura!)",
"descriptionOff": "Enviar la contrasenya com a fitxa + sal"
}
},
"actions": {
"add": "Afegir un servidor",
"testConnection": "Comprovar la connexió",
"save": "Desar",
"edit": "Editar el servidor",
"delete": "Esborrar"
},
"messages": {
"connectionOk": "Connexió a {{address}} OK!",
"connectionFailed": "La connexió a {{address}} ha fallat, comprova la configuració o el servidor"
},
"name": "Servidors"
},
"network": {
"name": "Xarxa",
"values": {
"seconds": "{{value}} segons",
"kbps": "{{value}}kbit/s",
"unlimitedKbps": "Il·limitat"
},
"options": {
"maxBuffer": {
"title": "Temps màxim de buffer"
},
"maxBitrateWifi": {
"title": "Taxa de bits màxima (Wi-Fi)"
},
"maxBitrateMobile": {
"title": "Taxa de bits màxima (mòbil)"
},
"minBuffer": {
"title": "Temps mínim de buffer"
}
}
},
"music": {
"options": {
"scrobble": {
"title": "Capturar la lectura",
"descriptionOn": "Capturar l'historial de reproduccions",
"descriptionOff": "No capturar l'historial de reproducció"
}
},
"name": "Música"
},
"reset": {
"name": "Reinicialitzar",
"actions": {
"clearImageCache": "Esborrar la memòria cau d'imatges"
}
},
"about": {
"name": "Quant a",
"version": "versió {{version}}",
"actions": {
"projectHomepage": "Pàgina d'inici del projecte",
"licenses": "Llicències"
}
}
},
"search": {
"nowPlayingContext": "Resultats de la cerca",
"inputPlaceholder": "Cercar",
"moreResults": "Més…",
"headerTitle": "Cercar: {{query}}"
}
}
-92
View File
@@ -1,92 +0,0 @@
{
"resources": {
"album": {
"lists": {
"byGenre": "Efter genre",
"alphabeticalByName": "Efter navn",
"alphabeticalByArtist": "Efter kunstner",
"byYear": "Efter år",
"sort": "Sortér albums"
},
"actions": {
"play": "Afspil album",
"view": "Se album"
}
},
"artist": {
"name": "Kunstner",
"name_plural": "Kunstnere",
"lists": {
"sort": "Sortér kunstnere",
"alphabeticalByName": "Efter navn"
},
"actions": {
"view": "Se kunstnere"
}
},
"song": {
"lists": {
"artistTopSongs": "Top sange"
},
"name": "Sang",
"name_plural": "Sange"
}
},
"navigation": {
"tabs": {
"library": "Bibliotek",
"search": "Søg",
"settings": "Indstillinger"
}
},
"search": {
"inputPlaceholder": "Søg",
"headerTitle": "Søg: {{query}}",
"nowPlayingContext": "Søgeresultater",
"moreResults": "Mere…"
},
"settings": {
"servers": {
"name": "Servere",
"fields": {
"address": "Adresse",
"username": "Brugernavn",
"password": "Adgangskode"
},
"actions": {
"add": "Tilføj server",
"edit": "Redigér server",
"testConnection": "Test forbindelse",
"delete": "Slet",
"save": "Gem"
},
"messages": {
"connectionOk": "Forbindelse til {{address}} OK!"
}
},
"network": {
"name": "Netværk",
"values": {
"kbps": "{{value}}kbps",
"unlimitedKbps": "Ubegrænset",
"seconds": "{{value}} sekunder"
}
},
"music": {
"name": "Musik"
},
"reset": {
"name": "Nulstil",
"actions": {
"clearImageCache": "Ryd billede cache"
}
},
"about": {
"name": "Omkring",
"version": "version {{version}}",
"actions": {
"licenses": "Licenser"
}
}
}
}
-152
View File
@@ -1,152 +0,0 @@
{
"resources": {
"song": {
"lists": {
"artistTopSongs": "Top Lieder"
},
"name": "Lied",
"name_plural": "Lieder"
},
"album": {
"name": "Album",
"name_plural": "Alben",
"lists": {
"sort": "Alben sortieren",
"random": "Zufällig",
"frequent": "Häufig abgespielt",
"recent": "Kürzlich abgespielt",
"starred": "Favoriten",
"byYear": "Nach Jahr",
"byGenre": "Nach Genre",
"alphabeticalByName": "Nach Name",
"newest": "Kürzlich hinzugefügt",
"alphabeticalByArtist": "Nach Interpreten"
},
"actions": {
"play": "Album abspielen",
"view": "Album anzeigen"
}
},
"artist": {
"name": "Interpret",
"name_plural": "Interpreten",
"lists": {
"sort": "Interpreten sortieren",
"random": "Zufällig",
"alphabeticalByName": "Nach Name",
"starred": "Favoriten"
},
"actions": {
"view": "Interpret anzeigen"
}
},
"playlist": {
"name": "Wiedergabeliste",
"name_plural": "Wiedergabelisten",
"actions": {
"play": "Wiedergabeliste abspielen"
}
},
"queue": {
"name": "Warteschlange",
"name_plural": "Warteschlangen"
}
},
"context": {
"actions": {
"star": "Markieren",
"unstar": "Markierung entfernen"
}
},
"navigation": {
"tabs": {
"home": "Startseite",
"library": "Bibliothek",
"search": "Suche",
"settings": "Einstellungen"
}
},
"search": {
"inputPlaceholder": "Suche",
"headerTitle": "Suche: {{query}}",
"nowPlayingContext": "Suchergebnis",
"moreResults": "Mehr…"
},
"settings": {
"servers": {
"fields": {
"address": "Adresse",
"password": "Passwort",
"username": "Nutzername"
},
"options": {
"forcePlaintextPassword": {
"title": "Erzwinge Klartextpasswort",
"descriptionOn": "Passwort als Klartext senden (Veraltet, stellen Sie sicher, dass Ihre Verbindung sicher ist!)",
"descriptionOff": "Sende Passwort als Token + Salt"
}
},
"actions": {
"add": "Server hinzufügen",
"edit": "Server bearbeiten",
"testConnection": "Verbindung testen",
"delete": "Löschen",
"save": "Speichern"
},
"messages": {
"connectionOk": "Verbindung zu {{address}} ist OK!",
"connectionFailed": "Verbindung zu {{address}} fehlgeschlagen, überprüfe Einstellungen oder Server"
},
"name": "Server"
},
"network": {
"name": "Netzwerk",
"values": {
"kbps": "{{value}}kbps",
"unlimitedKbps": "Unbegrenzt",
"seconds": "{{value}} Sekunden"
},
"options": {
"maxBitrateWifi": {
"title": "Maximale Bitrate (WLAN)"
},
"maxBuffer": {
"title": "Maxilmale Pufferzeit"
},
"minBuffer": {
"title": "Minimale Pufferzeit"
},
"maxBitrateMobile": {
"title": "Maximale Bitrate (Mobil)"
}
}
},
"music": {
"name": "Musik",
"options": {
"scrobble": {
"descriptionOn": "Scrobble Wiedergabeverlauf",
"descriptionOff": "Kein Scrobble für Wiedergabeverlauf",
"title": "Scrobble Wiedergabe"
}
}
},
"reset": {
"name": "Zurücksetzen",
"actions": {
"clearImageCache": "Bildzwischenspeicher löschen"
}
},
"about": {
"name": "Über",
"actions": {
"projectHomepage": "Projektseite",
"licenses": "Lizenzen"
},
"version": "Version {{version}}"
}
},
"messages": {
"nothingHere": "Hier ist nichts…"
}
}
-152
View File
@@ -1,152 +0,0 @@
{
"resources": {
"song": {
"name": "Song",
"name_plural": "Songs",
"lists": {
"artistTopSongs": "Top Songs"
}
},
"album": {
"name": "Album",
"name_plural": "Albums",
"lists": {
"sort": "Sort Albums",
"random": "Random",
"newest": "Recently Added",
"frequent": "Frequently Played",
"recent": "Recently Played",
"starred": "Starred",
"alphabeticalByName": "By Name",
"alphabeticalByArtist": "By Artist",
"byYear": "By Year",
"byGenre": "By Genre"
},
"actions": {
"play": "Play Album",
"view": "View Album"
}
},
"artist": {
"name": "Artist",
"name_plural": "Artists",
"lists": {
"sort": "Sort Artists",
"random": "Random",
"starred": "Starred",
"alphabeticalByName": "By Name"
},
"actions": {
"view": "View Artist"
}
},
"playlist": {
"name": "Playlist",
"name_plural": "Playlists",
"actions": {
"play": "Play Playlist"
}
},
"queue": {
"name": "Queue",
"name_plural": "Queues"
}
},
"context": {
"actions": {
"star": "Star",
"unstar": "Unstar"
}
},
"navigation": {
"tabs": {
"home": "Home",
"library": "Library",
"search": "Search",
"settings": "Settings"
}
},
"messages": {
"nothingHere": "Nothing here…"
},
"search": {
"inputPlaceholder": "Search",
"headerTitle": "Search: {{query}}",
"moreResults": "More…",
"nowPlayingContext": "Search Results"
},
"settings": {
"servers": {
"name": "Servers",
"fields": {
"address": "Address",
"username": "Username",
"password": "Password"
},
"options": {
"forcePlaintextPassword": {
"title": "Force plaintext password",
"descriptionOn": "Send password in plaintext (legacy, make sure your connection is secure!)",
"descriptionOff": "Send password as token + salt"
}
},
"actions": {
"add": "Add Server",
"edit": "Edit Server",
"testConnection": "Test Connection",
"delete": "Delete",
"save": "Save"
},
"messages": {
"connectionOk": "Connection to {{address}} OK!",
"connectionFailed": "Connection to {{address}} failed, check settings or server"
}
},
"network": {
"name": "Network",
"values": {
"kbps": "{{value}}kbps",
"unlimitedKbps": "Unlimited",
"seconds": "{{value}} seconds"
},
"options": {
"maxBitrateWifi": {
"title": "Maximum bitrate (Wi-Fi)"
},
"maxBitrateMobile": {
"title": "Maximum bitrate (mobile)"
},
"minBuffer": {
"title": "Minimum buffer time"
},
"maxBuffer": {
"title": "Maximum buffer time"
}
}
},
"music": {
"name": "Music",
"options": {
"scrobble": {
"title": "Scrobble plays",
"descriptionOn": "Scrobble play history",
"descriptionOff": "Don't scrobble play history"
}
}
},
"reset": {
"name": "Reset",
"actions": {
"clearImageCache": "Clear Image Cache"
}
},
"about": {
"name": "About",
"version": "version {{version}}",
"actions": {
"projectHomepage": "Project Homepage",
"licenses": "Licenses"
}
}
}
}
-152
View File
@@ -1,152 +0,0 @@
{
"resources": {
"album": {
"name": "Album",
"name_plural": "Albums",
"lists": {
"random": "Aléatoire",
"newest": "Récemment Ajouté",
"frequent": "Fréquemment Joué",
"recent": "Récemment Joué",
"alphabeticalByName": "Par Nom",
"byYear": "Par Année",
"alphabeticalByArtist": "Par Artiste",
"byGenre": "Par Genre",
"starred": "Favoris",
"sort": "Trier les albums"
},
"actions": {
"play": "Jouer l'album",
"view": "Voir l'album"
}
},
"song": {
"name": "Chanson",
"name_plural": "Chansons",
"lists": {
"artistTopSongs": "Meilleures Chansons"
}
},
"artist": {
"name": "Artiste",
"name_plural": "Artistes",
"lists": {
"random": "Aléatoire",
"starred": "Favoris",
"alphabeticalByName": "Par Nom",
"sort": "Trier les artistes"
},
"actions": {
"view": "Voir l'artiste"
}
},
"playlist": {
"actions": {
"play": "Lire la playlist"
},
"name": "Playlist",
"name_plural": "Playlists"
},
"queue": {
"name": "File d'attente",
"name_plural": "Files d'attente"
}
},
"settings": {
"network": {
"values": {
"seconds": "{{value}} secondes",
"unlimitedKbps": "Illimité",
"kbps": "{{value}}kbit/s"
},
"options": {
"maxBitrateWifi": {
"title": "Débit binaire maximum (Wi-Fi)"
},
"maxBitrateMobile": {
"title": "Débit binaire maximum (mobile)"
},
"maxBuffer": {
"title": "Temps maximum en mémoire tampon"
},
"minBuffer": {
"title": "Temps minimum en mémoire tampon"
}
},
"name": "Réseau"
},
"servers": {
"fields": {
"username": "Nom d'utilisateur",
"address": "Adresse",
"password": "Mot de passe"
},
"actions": {
"testConnection": "Tester la connexion",
"add": "Ajouter un serveur",
"delete": "Supprimer",
"save": "Sauvegarder",
"edit": "Modifier le serveur"
},
"name": "Serveurs",
"options": {
"forcePlaintextPassword": {
"title": "Forcer le mot de passe en texte clair",
"descriptionOn": "Envoyer le mot de passe en test clair (héritage, assurez-vous que la connexion est sécurisée !)",
"descriptionOff": "Envoyer le mot de passe sous forme de jeton + salage"
}
},
"messages": {
"connectionOk": "Connexion à {{address}} OK !",
"connectionFailed": "Échec de la connexion à {{address}}, vérifiez les paramètres ou le serveur"
}
},
"music": {
"name": "Musique",
"options": {
"scrobble": {
"descriptionOff": "Ne pas scrobbler l'historique de lecture",
"descriptionOn": "Scrobbler l'historique de lecture",
"title": "Scrobbler la lecture"
}
}
},
"about": {
"version": "version {{version}}",
"name": "À propos",
"actions": {
"licenses": "Licenses",
"projectHomepage": "Page d'accueil du projet"
}
},
"reset": {
"actions": {
"clearImageCache": "Vider le cache d'images"
},
"name": "Réinitialiser"
}
},
"navigation": {
"tabs": {
"library": "Bibliothèque",
"home": "Accueil",
"search": "Recherche",
"settings": "Paramètres"
}
},
"search": {
"headerTitle": "Recherche : {{query}}",
"inputPlaceholder": "Recherche",
"moreResults": "Plus…",
"nowPlayingContext": "Résultats de recherche"
},
"context": {
"actions": {
"star": "Mettre en favoris",
"unstar": "Enlever des favoris"
}
},
"messages": {
"nothingHere": "Rien ici…"
}
}
-152
View File
@@ -1,152 +0,0 @@
{
"resources": {
"artist": {
"name": "Artista",
"name_plural": "Artisti",
"actions": {
"view": "Vedi artista"
},
"lists": {
"random": "Casuale",
"starred": "Preferiti",
"sort": "Ordina artisti",
"alphabeticalByName": "Per nome"
}
},
"song": {
"lists": {
"artistTopSongs": "Brani più popolari"
},
"name": "Brano",
"name_plural": "Brani"
},
"album": {
"name": "Album",
"name_plural": "Album",
"lists": {
"random": "Casuale",
"newest": "Aggiunti di recente",
"recent": "Ascoltati di recente",
"alphabeticalByName": "Per nome",
"alphabeticalByArtist": "Per artista",
"byYear": "Per anno",
"byGenre": "Per genere",
"sort": "Ordina album",
"frequent": "Ascoltati frequentemente",
"starred": "Preferiti"
},
"actions": {
"play": "Riproduci album",
"view": "Vedi album"
}
},
"playlist": {
"name": "Playlist",
"name_plural": "Playlist",
"actions": {
"play": "Riproduci playlist"
}
},
"queue": {
"name": "Coda",
"name_plural": "Code"
}
},
"settings": {
"servers": {
"fields": {
"password": "Password",
"address": "Indirizzo",
"username": "Nome utente"
},
"options": {
"forcePlaintextPassword": {
"title": "Forza password in chiaro",
"descriptionOn": "Invia password in chiaro (deprecato, assicurati che la tua connessione sia sicura!)",
"descriptionOff": "Invia la password come token + salt"
}
},
"actions": {
"delete": "Rimuovi",
"edit": "Modifica server",
"add": "Aggiungi server",
"save": "Salva",
"testConnection": "Prova connessione"
},
"name": "Server",
"messages": {
"connectionOk": "Connesso a {{address}} con successo!",
"connectionFailed": "Connessione a {{address}} fallita, controlla le impostazioni o il server"
}
},
"network": {
"name": "Rete",
"values": {
"kbps": "{{value}}kbps",
"unlimitedKbps": "Illimitato",
"seconds": "{{value}} secondi"
},
"options": {
"maxBitrateWifi": {
"title": "Bitrate massimo (Wi-Fi)"
},
"maxBitrateMobile": {
"title": "Bitrate massimo (rete dati)"
},
"minBuffer": {
"title": "Tempo di buffer minimo"
},
"maxBuffer": {
"title": "Tempo di buffer massimo"
}
}
},
"music": {
"name": "Musica",
"options": {
"scrobble": {
"title": "Scrobbling delle riproduzioni",
"descriptionOn": "Scrobbling della cronologia di ascolto",
"descriptionOff": "Non eseguire lo scrobbling della cronologia d'ascolto"
}
}
},
"reset": {
"name": "Reimposta",
"actions": {
"clearImageCache": "Pulisci la cache delle immagini"
}
},
"about": {
"name": "Informazioni",
"version": "versione {{version}}",
"actions": {
"projectHomepage": "Pagina principale del progetto",
"licenses": "Licenze"
}
}
},
"context": {
"actions": {
"star": "Aggiungi ai preferiti",
"unstar": "Rimuovi dai preferiti"
}
},
"navigation": {
"tabs": {
"home": "Home",
"library": "Libreria",
"search": "Cerca",
"settings": "Impostazioni"
}
},
"messages": {
"nothingHere": "Non c'è niente qui…"
},
"search": {
"inputPlaceholder": "Ricerca",
"headerTitle": "Ricerca: {{query}}",
"moreResults": "Mostra di più…",
"nowPlayingContext": "Risultati della ricerca"
}
}
-55
View File
@@ -1,55 +0,0 @@
{
"resources": {
"album": {
"lists": {
"random": "ランダムアルバム",
"frequent": "よく聴くアルバム",
"recent": "最近再生した",
"starred": "星付きアルバム"
},
"name": "アルバム"
},
"song": {
"name": "歌",
"lists": {
"artistTopSongs": "人気曲"
}
},
"artist": {
"name": "アーティスト"
},
"playlist": {
"name": "プレイリスト"
}
},
"navigation": {
"tabs": {
"home": "ホーム",
"library": "ライブラリ",
"search": "検索",
"settings": "設定"
}
},
"search": {
"inputPlaceholder": "検索"
},
"settings": {
"servers": {
"name": "サーバ"
},
"network": {
"name": "ネット"
},
"music": {
"name": "音楽"
},
"reset": {
"name": "リセット"
},
"about": {
"actions": {
"projectHomepage": "ホームページ"
}
}
}
}
-152
View File
@@ -1,152 +0,0 @@
{
"resources": {
"artist": {
"name": "Artist",
"name_plural": "Artister",
"lists": {
"sort": "Sorter artister",
"random": "Tilfeldig",
"starred": "Stjernemerket",
"alphabeticalByName": "Etter navn"
},
"actions": {
"view": "Vis artist"
}
},
"playlist": {
"name": "Spilleliste",
"name_plural": "Spillelister",
"actions": {
"play": "Spill av spilleliste"
}
},
"song": {
"lists": {
"artistTopSongs": "Toppspor"
},
"name": "Spor",
"name_plural": "Spor"
},
"album": {
"name": "Album",
"name_plural": "Album",
"lists": {
"sort": "Sorter album",
"random": "Tilfeldig",
"newest": "Nylig tillagt",
"frequent": "Ofte spilt",
"recent": "Nylig spilt",
"starred": "Stjernemerket",
"alphabeticalByName": "Etter navn",
"alphabeticalByArtist": "Etter artist",
"byYear": "Etter år",
"byGenre": "Etter sjanger"
},
"actions": {
"play": "Spill album",
"view": "Vis album"
}
},
"queue": {
"name": "Kø",
"name_plural": "Køer"
}
},
"settings": {
"servers": {
"actions": {
"add": "Legg til tjener",
"testConnection": "Test tilkobling",
"delete": "Slett",
"save": "Lagre",
"edit": "Rediger tjener"
},
"messages": {
"connectionOk": "Tilkobling til {{address}} OK.",
"connectionFailed": "Tilkobling til {{address}} mislyktes. Sjekk innstillingene eller tjeneren."
},
"name": "Tjenere",
"fields": {
"address": "Adresse",
"username": "Brukernavn",
"password": "Passord"
},
"options": {
"forcePlaintextPassword": {
"title": "Påtving klartekstspassord",
"descriptionOn": "Send passord i klartekst (Foreldet. Forsikre deg om at tilkoblingen er sikker.)",
"descriptionOff": "Send passord som symbol + salt"
}
}
},
"network": {
"name": "Nettverk",
"values": {
"kbps": "{{value}} kbps",
"unlimitedKbps": "Ubegrenset",
"seconds": "{{value}} sekunder"
},
"options": {
"maxBitrateWifi": {
"title": "Maksimal bitrate (Wi-Fi)"
},
"maxBitrateMobile": {
"title": "Maksimal bitrate (mobil)"
},
"minBuffer": {
"title": "Minimal mellomlagringstid"
},
"maxBuffer": {
"title": "Maksimal mellomlagringstid"
}
}
},
"music": {
"name": "Musikk",
"options": {
"scrobble": {
"title": "Sporinfodelingsavspillinger",
"descriptionOn": "Sporinfodelings-avspillinghistorikk",
"descriptionOff": "Ikke utfør sporinfodeling av avspillingshistorikk"
}
}
},
"reset": {
"name": "Tilbakestill",
"actions": {
"clearImageCache": "Tøm bildehurtiglager"
}
},
"about": {
"name": "Om",
"version": "versjon {{version}}",
"actions": {
"projectHomepage": "Prosjekthjemmeside",
"licenses": "Lisenser"
}
}
},
"context": {
"actions": {
"star": "Stjernemerk",
"unstar": "Fjern stjernemerking"
}
},
"navigation": {
"tabs": {
"home": "Hjem",
"library": "Bibliotek",
"search": "Søk",
"settings": "Innstillinger"
}
},
"search": {
"inputPlaceholder": "Søk",
"headerTitle": "Søk: {{query}}",
"moreResults": "Mer …",
"nowPlayingContext": "Søkeresultater"
},
"messages": {
"nothingHere": "Ingenting her …"
}
}
-157
View File
@@ -1,157 +0,0 @@
{
"settings": {
"servers": {
"actions": {
"delete": "Удалить",
"add": "Добавить сервер",
"edit": "Редактировать сервер",
"testConnection": "Проверить подключение",
"save": "Сохранить"
},
"name": "Серверы",
"fields": {
"address": "Адрес",
"username": "Имя пользователя",
"password": "Пароль"
},
"options": {
"forcePlaintextPassword": {
"descriptionOn": "Отправить пароль в виде текста (устарело, убедитесь, что ваше соединение безопасно!)",
"descriptionOff": "Отправить пароль в виде токена",
"title": "Принудительный текстовый пароль"
}
},
"messages": {
"connectionOk": "Подключение к {{address}} установлено!",
"connectionFailed": "Не удалось подключиться к {{address}}, проверьте настройки или сервер"
}
},
"network": {
"name": "Сеть",
"values": {
"kbps": "{{value}} кбит/с",
"unlimitedKbps": "Без ограничений",
"seconds": "{{value}} секунд"
},
"options": {
"maxBitrateWifi": {
"title": "Максимальный битрейт (Wi-Fi)"
},
"maxBitrateMobile": {
"title": "Максимальный битрейт (мобильный интернет)"
},
"minBuffer": {
"title": "Минимальное время буферизации"
},
"maxBuffer": {
"title": "Максимальное время буферизации"
}
}
},
"music": {
"name": "Музыка",
"options": {
"scrobble": {
"title": "Синхронизация воспроизведения",
"descriptionOff": "Не синхронизировать историю воспроизведений",
"descriptionOn": "Синхронизация истории воспроизведения"
}
}
},
"reset": {
"name": "Сброс",
"actions": {
"clearImageCache": "Очистить кэш изображения"
}
},
"about": {
"name": "О Subtracks",
"version": "версия {{version}}",
"actions": {
"projectHomepage": "Сайт проекта",
"licenses": "Лицензии"
}
}
},
"resources": {
"album": {
"name_0": "Альбом",
"name_1": "Альбома",
"name_2": "Альбомов",
"lists": {
"sort": "Сортировка альбомов",
"random": "Случайно",
"newest": "Недавно добавленные",
"frequent": "Часто проигрываемые",
"recent": "Недавно проигранные",
"starred": "Избранные",
"alphabeticalByName": "По имени",
"alphabeticalByArtist": "По исполнителю",
"byYear": "По году",
"byGenre": "По жанру"
},
"actions": {
"play": "Воспроизвести альбом",
"view": "Посмотреть альбом"
}
},
"song": {
"name_0": "Трек",
"name_1": "Трека",
"name_2": "Треков",
"lists": {
"artistTopSongs": "Лучшие треки"
}
},
"artist": {
"name_0": "Исполнитель",
"name_1": "Исполнителя",
"name_2": "Исполнителей",
"lists": {
"sort": "Сортировать исполнителей",
"random": "Случайно",
"starred": "Избранные",
"alphabeticalByName": "По имени"
},
"actions": {
"view": "Посмотреть исполнителя"
}
},
"playlist": {
"name_0": "Плейлист",
"name_1": "Плейлиста",
"name_2": "Плейлистов",
"actions": {
"play": "Воспроизвести плейлист"
}
},
"queue": {
"name_0": "Очередь",
"name_1": "Очереди",
"name_2": "Очередей"
}
},
"context": {
"actions": {
"star": "Избранное",
"unstar": "Убрать из избранного"
}
},
"navigation": {
"tabs": {
"library": "Библиотека",
"search": "Поиск",
"settings": "Настройки",
"home": "Главная"
}
},
"messages": {
"nothingHere": "Здесь ничего нет…"
},
"search": {
"inputPlaceholder": "Поиск",
"headerTitle": "Поиск: {{query}}",
"moreResults": "Больше…",
"nowPlayingContext": "Результаты поиска"
}
}
-147
View File
@@ -1,147 +0,0 @@
{
"context": {
"actions": {
"unstar": "移除收藏",
"star": "收藏"
}
},
"settings": {
"servers": {
"name": "服务器",
"messages": {
"connectionFailed": "连接到 {{address}} 失败,检查设置或服务器",
"connectionOk": "连接到 {{address}} 正常!"
},
"options": {
"forcePlaintextPassword": {
"title": "强制使用明文密码",
"descriptionOn": "密码以明文发送(不推荐,注意链接安全!)",
"descriptionOff": "密码以 token + salt 加密发送"
}
},
"actions": {
"add": "添加服务器",
"testConnection": "测试连接",
"save": "保存",
"edit": "编辑服务器",
"delete": "删除"
},
"fields": {
"password": "密码",
"username": "用户名",
"address": "地址"
}
},
"network": {
"name": "网络",
"values": {
"seconds": "{{value}} 秒",
"kbps": "{{value}}kbps",
"unlimitedKbps": "不限制"
},
"options": {
"maxBitrateMobile": {
"title": "最大比特率 (3G/4G/5G)"
},
"minBuffer": {
"title": "最小缓冲时间"
},
"maxBuffer": {
"title": "最大缓冲时间"
},
"maxBitrateWifi": {
"title": "最大比特率 (Wi-Fi)"
}
}
},
"music": {
"name": "音乐",
"options": {
"scrobble": {
"title": "Scrobble模式",
"descriptionOn": "Scrobble播放历史",
"descriptionOff": "不记录scrobble历史"
}
}
},
"reset": {
"name": "重置",
"actions": {
"clearImageCache": "清除图片缓存"
}
},
"about": {
"name": "关于",
"version": "版本 {{version}}",
"actions": {
"projectHomepage": "项目地址",
"licenses": "许可"
}
}
},
"resources": {
"album": {
"actions": {
"view": "查看专辑",
"play": "播放专辑"
},
"name": "专辑",
"lists": {
"newest": "最近添加",
"frequent": "播放最多",
"alphabeticalByName": "根据名称",
"alphabeticalByArtist": "根据歌手",
"byYear": "根据年份",
"random": "随机",
"sort": "专辑排序",
"recent": "最近播放",
"byGenre": "根据类型",
"starred": "已收藏"
}
},
"playlist": {
"actions": {
"play": "全部播放"
},
"name": "播放列表"
},
"song": {
"name": "歌曲",
"lists": {
"artistTopSongs": "热门歌曲"
}
},
"artist": {
"name": "歌手",
"lists": {
"starred": "已收藏",
"sort": "歌手排序",
"random": "随机",
"alphabeticalByName": "根据名称"
},
"actions": {
"view": "查看歌手"
}
},
"queue": {
"name": "队列"
}
},
"navigation": {
"tabs": {
"home": "首页",
"library": "所有",
"search": "搜索",
"settings": "设置"
}
},
"search": {
"inputPlaceholder": "搜索",
"headerTitle": "搜索: {{query}}",
"moreResults": "更多…",
"nowPlayingContext": "搜索结果"
},
"messages": {
"nothingHere": "什么都没有…"
}
}
File diff suppressed because it is too large Load Diff
+63 -641
View File
@@ -1469,32 +1469,6 @@ THE SOFTWARE.
----- -----
The following software may be included in this product: broadcast-channel. A copy of the source code may be downloaded from git+https://github.com/pubkey/broadcast-channel.git. This software contains the following license and notice below:
MIT License
Copyright (c) 2018 Daniel Meyer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: browserslist. A copy of the source code may be downloaded from https://github.com/browserslist/browserslist.git. This software contains the following license and notice below: The following software may be included in this product: browserslist. A copy of the source code may be downloaded from https://github.com/browserslist/browserslist.git. This software contains the following license and notice below:
The MIT License (MIT) The MIT License (MIT)
@@ -2572,33 +2546,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
----- -----
The following software may be included in this product: content-disposition, depd, vary. A copy of the source code may be downloaded from https://github.com/jshttp/content-disposition.git (content-disposition), https://github.com/dougwilson/nodejs-depd.git (depd), https://github.com/jshttp/vary.git (vary). This software contains the following license and notice below:
(The MIT License)
Copyright (c) 2014-2017 Douglas Christopher Wilson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-----
The following software may be included in this product: convert-source-map. A copy of the source code may be downloaded from git://github.com/thlorenz/convert-source-map.git. This software contains the following license and notice below: The following software may be included in this product: convert-source-map. A copy of the source code may be downloaded from git://github.com/thlorenz/convert-source-map.git. This software contains the following license and notice below:
Copyright 2013 Thorsten Lorenz. Copyright 2013 Thorsten Lorenz.
@@ -2980,6 +2927,33 @@ THE SOFTWARE.
----- -----
The following software may be included in this product: depd, vary. A copy of the source code may be downloaded from https://github.com/dougwilson/nodejs-depd.git (depd), https://github.com/jshttp/vary.git (vary). This software contains the following license and notice below:
(The MIT License)
Copyright (c) 2014-2017 Douglas Christopher Wilson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-----
The following software may be included in this product: destroy, ee-first, mime-db. A copy of the source code may be downloaded from https://github.com/stream-utils/destroy.git (destroy), https://github.com/jonathanong/ee-first.git (ee-first), https://github.com/jshttp/mime-db.git (mime-db). This software contains the following license and notice below: The following software may be included in this product: destroy, ee-first, mime-db. A copy of the source code may be downloaded from https://github.com/stream-utils/destroy.git (destroy), https://github.com/jonathanong/ee-first.git (ee-first), https://github.com/jshttp/mime-db.git (mime-db). This software contains the following license and notice below:
The MIT License (MIT) The MIT License (MIT)
@@ -3006,32 +2980,6 @@ THE SOFTWARE.
----- -----
The following software may be included in this product: detect-node. A copy of the source code may be downloaded from https://github.com/iliakan/detect-node. This software contains the following license and notice below:
MIT License
Copyright (c) 2017 Ilya Kantor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: electron-to-chromium. A copy of the source code may be downloaded from https://github.com/kilian/electron-to-chromium/. This software contains the following license and notice below: The following software may be included in this product: electron-to-chromium. A copy of the source code may be downloaded from https://github.com/kilian/electron-to-chromium/. This software contains the following license and notice below:
Copyright 2018 Kilian Valkhof Copyright 2018 Kilian Valkhof
@@ -3863,30 +3811,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----- -----
The following software may be included in this product: html-escaper. A copy of the source code may be downloaded from https://github.com/WebReflection/html-escaper.git. This software contains the following license and notice below:
Copyright (C) 2017-present by Andrea Giammarchi - @WebReflection
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----
The following software may be included in this product: http-errors. A copy of the source code may be downloaded from https://github.com/jshttp/http-errors.git. This software contains the following license and notice below: The following software may be included in this product: http-errors. A copy of the source code may be downloaded from https://github.com/jshttp/http-errors.git. This software contains the following license and notice below:
The MIT License (MIT) The MIT License (MIT)
@@ -3914,32 +3838,6 @@ THE SOFTWARE.
----- -----
The following software may be included in this product: i18next. A copy of the source code may be downloaded from https://github.com/i18next/i18next.git. This software contains the following license and notice below:
The MIT License (MIT)
Copyright (c) 2022 i18next
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: ieee754. A copy of the source code may be downloaded from git://github.com/feross/ieee754.git. This software contains the following license and notice below: The following software may be included in this product: ieee754. A copy of the source code may be downloaded from git://github.com/feross/ieee754.git. This software contains the following license and notice below:
Copyright 2008 Fair Oaks Labs, Inc. Copyright 2008 Fair Oaks Labs, Inc.
@@ -4282,31 +4180,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----- -----
The following software may be included in this product: js-sha3. A copy of the source code may be downloaded from https://github.com/emn178/js-sha3.git. This software contains the following license and notice below:
Copyright 2015-2018 Chen, Yi-Cyuan
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-----
The following software may be included in this product: js-tokens. A copy of the source code may be downloaded from https://github.com/lydell/js-tokens.git. This software contains the following license and notice below: The following software may be included in this product: js-tokens. A copy of the source code may be downloaded from https://github.com/lydell/js-tokens.git. This software contains the following license and notice below:
The MIT License (MIT) The MIT License (MIT)
@@ -4520,7 +4393,7 @@ OR OTHER DEALINGS IN THE SOFTWARE.
----- -----
The following software may be included in this product: lodash, lodash.template, lodash.templatesettings. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash), https://github.com/lodash/lodash.git (lodash.template), https://github.com/lodash/lodash.git (lodash.templatesettings). This software contains the following license and notice below: The following software may be included in this product: lodash, lodash.merge, lodash.template, lodash.templatesettings. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash), https://github.com/lodash/lodash.git (lodash.merge), https://github.com/lodash/lodash.git (lodash.template), https://github.com/lodash/lodash.git (lodash.templatesettings). This software contains the following license and notice below:
Copyright OpenJS Foundation and other contributors <https://openjsf.org/> Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -4867,31 +4740,6 @@ THE SOFTWARE.
----- -----
The following software may be included in this product: match-sorter. A copy of the source code may be downloaded from https://github.com/kentcdodds/match-sorter. This software contains the following license and notice below:
The MIT License (MIT)
Copyright (c) 2020 Kent C. Dodds
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: md5. A copy of the source code may be downloaded from git://github.com/pvorb/node-md5.git. This software contains the following license and notice below: The following software may be included in this product: md5. A copy of the source code may be downloaded from git://github.com/pvorb/node-md5.git. This software contains the following license and notice below:
Copyright © 2011-2012, Paul Vorbach. Copyright © 2011-2012, Paul Vorbach.
@@ -5002,34 +4850,6 @@ THE SOFTWARE.
----- -----
The following software may be included in this product: mime-db. A copy of the source code may be downloaded from https://github.com/jshttp/mime-db.git. This software contains the following license and notice below:
(The MIT License)
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2015-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-----
The following software may be included in this product: mkdirp. A copy of the source code may be downloaded from https://github.com/substack/node-mkdirp.git. This software contains the following license and notice below: The following software may be included in this product: mkdirp. A copy of the source code may be downloaded from https://github.com/substack/node-mkdirp.git. This software contains the following license and notice below:
Copyright 2010 James Halliday (mail@substack.net) Copyright 2010 James Halliday (mail@substack.net)
@@ -5561,32 +5381,6 @@ SOFTWARE.
----- -----
The following software may be included in this product: oblivious-set. A copy of the source code may be downloaded from https://github.com/pubkey/oblivious-set. This software contains the following license and notice below:
MIT License
Copyright (c) 2020 Daniel Meyer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: on-finished. A copy of the source code may be downloaded from https://github.com/jshttp/on-finished.git. This software contains the following license and notice below: The following software may be included in this product: on-finished. A copy of the source code may be downloaded from https://github.com/jshttp/on-finished.git. This software contains the following license and notice below:
(The MIT License) (The MIT License)
@@ -5721,29 +5515,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
----- -----
The following software may be included in this product: path, util. A copy of the source code may be downloaded from git://github.com/jinder/path.git (path), git://github.com/defunctzombie/node-util (util). This software contains the following license and notice below:
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-----
The following software may be included in this product: path-parse. A copy of the source code may be downloaded from https://github.com/jbgutierrez/path-parse.git. This software contains the following license and notice below: The following software may be included in this product: path-parse. A copy of the source code may be downloaded from https://github.com/jbgutierrez/path-parse.git. This software contains the following license and notice below:
The MIT License (MIT) The MIT License (MIT)
@@ -6134,58 +5905,6 @@ SOFTWARE.
----- -----
The following software may be included in this product: react-i18next. A copy of the source code may be downloaded from https://github.com/i18next/react-i18next.git. This software contains the following license and notice below:
The MIT License (MIT)
Copyright (c) 2022 i18next
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: react-native-blob-util. A copy of the source code may be downloaded from https://github.com/RonRadtke/react-native-blob-util. This software contains the following license and notice below:
MIT License
Copyright (c) 2017 xeiyan@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: react-native-fs. A copy of the source code may be downloaded from git@github.com:itinance/react-native-fs.git. This software contains the following license and notice below: The following software may be included in this product: react-native-fs. A copy of the source code may be downloaded from git@github.com:itinance/react-native-fs.git. This software contains the following license and notice below:
The MIT License (MIT) The MIT License (MIT)
@@ -6238,6 +5957,32 @@ SOFTWARE.
----- -----
The following software may be included in this product: react-native-get-random-values. A copy of the source code may be downloaded from https://github.com/LinusU/react-native-get-random-values.git. This software contains the following license and notice below:
MIT License
Copyright (c) 2018, 2020 Linus Unnebäck
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: react-native-image-colors. A copy of the source code may be downloaded from https://github.com/osamaqarem/react-native-image-colors. This software contains the following license and notice below: The following software may be included in this product: react-native-image-colors. A copy of the source code may be downloaded from https://github.com/osamaqarem/react-native-image-colors. This software contains the following license and notice below:
MIT License MIT License
@@ -6316,32 +6061,6 @@ SOFTWARE.
----- -----
The following software may be included in this product: react-native-localize. A copy of the source code may be downloaded from https://github.com/zoontek/react-native-localize.git. This software contains the following license and notice below:
MIT License
Copyright (c) 2017-present, Mathieu Acthernoene
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: react-native-popup-menu. A copy of the source code may be downloaded from git+ssh://git@github.com:instea/react-native-popup-menu.git. This software contains the following license and notice below: The following software may be included in this product: react-native-popup-menu. A copy of the source code may be downloaded from git+ssh://git@github.com:instea/react-native-popup-menu.git. This software contains the following license and notice below:
ISC License ISC License
@@ -6672,32 +6391,6 @@ Apache License
----- -----
The following software may be included in this product: react-native-uuid. A copy of the source code may be downloaded from git+https://github.com/eugenehp/react-native-uuid.git. This software contains the following license and notice below:
MIT License
Copyright (c) 2016-2021 Eugene Hauptmann
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: react-native-vector-icons. A copy of the source code may be downloaded from git://github.com/oblador/react-native-vector-icons.git. This software contains the following license and notice below: The following software may be included in this product: react-native-vector-icons. A copy of the source code may be downloaded from git://github.com/oblador/react-native-vector-icons.git. This software contains the following license and notice below:
The MIT License (MIT) The MIT License (MIT)
@@ -6724,32 +6417,6 @@ SOFTWARE.
----- -----
The following software may be included in this product: react-query. A copy of the source code may be downloaded from https://github.com/tannerlinsley/react-query.git. This software contains the following license and notice below:
MIT License
Copyright (c) 2019 Tanner Linsley
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: readable-stream. A copy of the source code may be downloaded from git://github.com/nodejs/readable-stream. This software contains the following license and notice below: The following software may be included in this product: readable-stream. A copy of the source code may be downloaded from git://github.com/nodejs/readable-stream. This software contains the following license and notice below:
Node.js is licensed for use as follows: Node.js is licensed for use as follows:
@@ -6905,32 +6572,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----- -----
The following software may be included in this product: remove-accents. A copy of the source code may be downloaded from https://github.com/tyxla/remove-accents. This software contains the following license and notice below:
The MIT License (MIT)
Copyright (c) 2015 Marin Atanasov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
The following software may be included in this product: remove-trailing-separator. A copy of the source code may be downloaded from git+https://github.com/darsain/remove-trailing-separator.git. This software contains the following license and notice below: The following software may be included in this product: remove-trailing-separator. A copy of the source code may be downloaded from git+https://github.com/darsain/remove-trailing-separator.git. This software contains the following license and notice below:
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
@@ -7982,212 +7623,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
----- -----
The following software may be included in this product: unload. A copy of the source code may be downloaded from git+https://github.com/pubkey/unload.git. This software contains the following license and notice below:
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2015-2016 Netflix, Inc., Microsoft Corp. and contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-----
The following software may be included in this product: unpipe. A copy of the source code may be downloaded from https://github.com/stream-utils/unpipe.git. This software contains the following license and notice below: The following software may be included in this product: unpipe. A copy of the source code may be downloaded from https://github.com/stream-utils/unpipe.git. This software contains the following license and notice below:
(The MIT License) (The MIT License)
@@ -8347,9 +7782,11 @@ SOFTWARE.
----- -----
The following software may be included in this product: vlq. A copy of the source code may be downloaded from https://github.com/Rich-Harris/vlq. This software contains the following license and notice below: The following software may be included in this product: uuid. A copy of the source code may be downloaded from https://github.com/uuidjs/uuid.git. This software contains the following license and notice below:
Copyright (c) 2017 [these people](https://github.com/Rich-Harris/vlq/graphs/contributors) The MIT License (MIT)
Copyright (c) 2010-2020 Robert Kieffer and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -8359,30 +7796,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
----- -----
The following software may be included in this product: void-elements. A copy of the source code may be downloaded from https://github.com/pugjs/void-elements.git. This software contains the following license and notice below: The following software may be included in this product: vlq. A copy of the source code may be downloaded from https://github.com/Rich-Harris/vlq. This software contains the following license and notice below:
(The MIT License) Copyright (c) 2017 [these people](https://github.com/Rich-Harris/vlq/graphs/contributors)
Copyright (c) 2014 hemanth Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
----- -----
@@ -14,9 +14,6 @@ public class MainActivity extends ReactActivity {
return "subtracks"; return "subtracks";
} }
// required by react-native-screens
// "This change is required to avoid crashes related to View state being not persisted consistently across Activity restarts."
// https://reactnavigation.org/docs/getting-started
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null); super.onCreate(null);
-6
View File
@@ -593,12 +593,6 @@
license: The Apache Software License, Version 2.0 license: The Apache Software License, Version 2.0
licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt
url: https://github.com/raphw/byte-buddy url: https://github.com/raphw/byte-buddy
- artifact: org.apache.commons:commons-lang3:+
name: commons-lang3
copyrightHolder: Original Author
license: The Apache Software License, Version 2.0
licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt
url: http://commons.apache.org/lang/
- artifact: org.checkerframework:checker-compat-qual:+ - artifact: org.checkerframework:checker-compat-qual:+
name: checker-compat-qual name: checker-compat-qual
copyrightHolder: Original Author copyrightHolder: Original Author
+4 -15
View File
@@ -2,12 +2,10 @@ import RootNavigator from '@app/navigation/RootNavigator'
import SplashPage from '@app/screens/SplashPage' import SplashPage from '@app/screens/SplashPage'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import React from 'react' import React from 'react'
import { StatusBar, StyleSheet, View } from 'react-native' import { StatusBar, View, StyleSheet } from 'react-native'
import { MenuProvider } from 'react-native-popup-menu'
import { QueryClientProvider } from 'react-query'
import ProgressHook from './components/ProgressHook' import ProgressHook from './components/ProgressHook'
import queryClient from './queryClient'
import { useStore } from './state/store' import { useStore } from './state/store'
import { MenuProvider } from 'react-native-popup-menu'
const Debug = () => { const Debug = () => {
const currentTrackTitle = useStore(store => store.currentTrack?.title) const currentTrackTitle = useStore(store => store.currentTrack?.title)
@@ -15,17 +13,10 @@ const Debug = () => {
return <></> return <></>
} }
const App = () => { const App = () => (
return (
<QueryClientProvider client={queryClient}>
<MenuProvider backHandler={true}> <MenuProvider backHandler={true}>
<View style={styles.appContainer}> <View style={styles.appContainer}>
<StatusBar <StatusBar animated={true} backgroundColor={'rgba(0, 0, 0, 0.3)'} barStyle={'light-content'} translucent={true} />
animated={true}
backgroundColor={'rgba(0, 0, 0, 0.3)'}
barStyle={'light-content'}
translucent={true}
/>
<SplashPage> <SplashPage>
<ProgressHook /> <ProgressHook />
<Debug /> <Debug />
@@ -33,9 +24,7 @@ const App = () => {
</SplashPage> </SplashPage>
</View> </View>
</MenuProvider> </MenuProvider>
</QueryClientProvider>
) )
}
const styles = StyleSheet.create({ const styles = StyleSheet.create({
appContainer: { appContainer: {
+1 -9
View File
@@ -16,13 +16,7 @@ const Button: React.FC<{
onPress={onPress} onPress={onPress}
disabled={disabled} disabled={disabled}
style={[styles.container, buttonStyle !== undefined ? styles[buttonStyle] : {}, style]}> style={[styles.container, buttonStyle !== undefined ? styles[buttonStyle] : {}, style]}>
{title ? ( {title ? <Text style={styles.text}>{title}</Text> : children}
<Text style={styles.text} numberOfLines={2} adjustsFontSizeToFit={true}>
{title}
</Text>
) : (
children
)}
</PressableOpacity> </PressableOpacity>
) )
} }
@@ -32,7 +26,6 @@ const styles = StyleSheet.create({
backgroundColor: colors.accent, backgroundColor: colors.accent,
paddingHorizontal: 10, paddingHorizontal: 10,
minHeight: 42, minHeight: 42,
maxHeight: 42,
justifyContent: 'center', justifyContent: 'center',
borderRadius: 1000, borderRadius: 1000,
}, },
@@ -50,7 +43,6 @@ const styles = StyleSheet.create({
fontFamily: font.bold, fontFamily: font.bold,
color: colors.text.primary, color: colors.text.primary,
paddingHorizontal: 14, paddingHorizontal: 14,
textAlign: 'center',
}, },
}) })
+22 -74
View File
@@ -1,19 +1,17 @@
import PressableOpacity from '@app/components/PressableOpacity' import PressableOpacity from '@app/components/PressableOpacity'
import { useStar } from '@app/hooks/query' import { useStar } from '@app/hooks/library'
import { StarrableItemType, Song, Artist, Album } from '@app/models/library' import { StarrableItemType, Song, Artist, Album } from '@app/models/library'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import font from '@app/styles/font' import font from '@app/styles/font'
import { NavigationProp, useNavigation } from '@react-navigation/native' import { NavigationProp, useNavigation } from '@react-navigation/native'
import { ReactComponentLike } from 'prop-types' import { ReactComponentLike } from 'prop-types'
import React from 'react' import React from 'react'
import { useTranslation } from 'react-i18next'
import { ScrollView, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native' import { ScrollView, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native'
import { Menu, MenuOption, MenuOptions, MenuTrigger, renderers } from 'react-native-popup-menu' import { Menu, MenuOption, MenuOptions, MenuTrigger, renderers } from 'react-native-popup-menu'
import IconFA from 'react-native-vector-icons/FontAwesome' import IconFA from 'react-native-vector-icons/FontAwesome'
import IconFA5 from 'react-native-vector-icons/FontAwesome5' import IconFA5 from 'react-native-vector-icons/FontAwesome5'
import CoverArt from './CoverArt' import CoverArt from './CoverArt'
import { Star } from './Star' import { Star } from './Star'
import { withSuspenseMemo } from './withSuspense'
const { SlideInMenu } = renderers const { SlideInMenu } = renderers
@@ -24,7 +22,6 @@ type ContextMenuProps = {
triggerTouchableStyle?: StyleProp<ViewStyle> triggerTouchableStyle?: StyleProp<ViewStyle>
onPress?: () => any onPress?: () => any
triggerOnLongPress?: boolean triggerOnLongPress?: boolean
disabled?: boolean
} }
type InternalContextMenuProps = ContextMenuProps & { type InternalContextMenuProps = ContextMenuProps & {
@@ -42,7 +39,6 @@ const ContextMenu: React.FC<InternalContextMenuProps> = ({
menuOptions, menuOptions,
children, children,
triggerOnLongPress, triggerOnLongPress,
disabled,
}) => { }) => {
menuStyle = menuStyle || { flex: 1 } menuStyle = menuStyle || { flex: 1 }
triggerWrapperStyle = triggerWrapperStyle || { flex: 1 } triggerWrapperStyle = triggerWrapperStyle || { flex: 1 }
@@ -51,12 +47,11 @@ const ContextMenu: React.FC<InternalContextMenuProps> = ({
return ( return (
<Menu renderer={SlideInMenu} style={menuStyle}> <Menu renderer={SlideInMenu} style={menuStyle}>
<MenuTrigger <MenuTrigger
disabled={disabled}
triggerOnLongPress={triggerOnLongPress === undefined ? true : triggerOnLongPress} triggerOnLongPress={triggerOnLongPress === undefined ? true : triggerOnLongPress}
customStyles={{ customStyles={{
triggerOuterWrapper: triggerOuterWrapperStyle, triggerOuterWrapper: triggerOuterWrapperStyle,
triggerWrapper: triggerWrapperStyle, triggerWrapper: triggerWrapperStyle,
triggerTouchable: { style: triggerTouchableStyle, disabled }, triggerTouchable: { style: triggerTouchableStyle },
TriggerTouchableComponent: PressableOpacity, TriggerTouchableComponent: PressableOpacity,
}} }}
onAlternativeAction={onPress}> onAlternativeAction={onPress}>
@@ -108,9 +103,7 @@ const ContextMenuIconTextOption = React.memo<ContextMenuIconTextOptionProps>(
return ( return (
<ContextMenuOption onSelect={onSelect}> <ContextMenuOption onSelect={onSelect}>
<View style={styles.icon}>{Icon}</View> <View style={styles.icon}>{Icon}</View>
<Text style={styles.optionText} numberOfLines={1} adjustsFontSizeToFit={true} minimumFontScale={0.6}> <Text style={styles.optionText}>{text}</Text>
{text}
</Text>
</ContextMenuOption> </ContextMenuOption>
) )
}, },
@@ -119,50 +112,15 @@ const ContextMenuIconTextOption = React.memo<ContextMenuIconTextOptionProps>(
const MenuHeader = React.memo<{ const MenuHeader = React.memo<{
coverArt?: string coverArt?: string
artistId?: string artistId?: string
albumId?: string
title: string title: string
subtitle?: string subtitle?: string
}>(({ coverArt, artistId, albumId, title, subtitle }) => { }>(({ coverArt, artistId, title, subtitle }) => (
let CoverArtComponent = <></>
if (artistId) {
CoverArtComponent = (
<CoverArt
type="artist"
artistId={artistId}
style={styles.coverArt}
resizeMode="cover"
round={true}
size="thumbnail"
fadeDuration={0}
/>
)
} else if (albumId) {
CoverArtComponent = (
<CoverArt
type="album"
albumId={albumId}
style={styles.coverArt}
resizeMode="cover"
size="thumbnail"
fadeDuration={0}
/>
)
} else {
CoverArtComponent = (
<CoverArt
type="cover"
coverArt={coverArt}
style={styles.coverArt}
resizeMode="cover"
size="thumbnail"
fadeDuration={0}
/>
)
}
return (
<View style={styles.menuHeader}> <View style={styles.menuHeader}>
{CoverArtComponent} {artistId ? (
<CoverArt type="artist" artistId={artistId} style={styles.coverArt} resizeMode={'cover'} round={true} />
) : (
<CoverArt type="cover" coverArt={coverArt} style={styles.coverArt} resizeMode={'cover'} />
)}
<View style={styles.menuHeaderText}> <View style={styles.menuHeaderText}>
<Text numberOfLines={1} style={styles.menuTitle}> <Text numberOfLines={1} style={styles.menuTitle}>
{title} {title}
@@ -176,33 +134,29 @@ const MenuHeader = React.memo<{
)} )}
</View> </View>
</View> </View>
) ))
})
const OptionStar = withSuspenseMemo<{ const OptionStar = React.memo<{
id: string id: string
type: StarrableItemType type: StarrableItemType
additionalText?: string additionalText?: string
}>(({ id, type, additionalText: text }) => { }>(({ id, type, additionalText: text }) => {
const { query, toggle } = useStar(id, type) const { starred, toggleStar } = useStar(id, type)
const { t } = useTranslation()
return ( return (
<ContextMenuIconTextOption <ContextMenuIconTextOption
IconComponentRaw={<Star starred={!!query.data} size={26} />} IconComponentRaw={<Star starred={starred} size={26} />}
text={(query.data ? t('context.actions.unstar') : t('context.actions.star')) + (text ? ` ${text}` : '')} text={(starred ? 'Unstar' : 'Star') + (text ? ` ${text}` : '')}
onSelect={() => toggle.mutate()} onSelect={toggleStar}
/> />
) )
}) })
const OptionViewArtist = withSuspenseMemo<{ const OptionViewArtist = React.memo<{
navigation: NavigationProp<any> navigation: NavigationProp<any>
artist?: string artist?: string
artistId?: string artistId?: string
}>(({ navigation, artist, artistId }) => { }>(({ navigation, artist, artistId }) => {
const { t } = useTranslation()
if (!artist || !artistId) { if (!artist || !artistId) {
return <></> return <></>
} }
@@ -212,19 +166,17 @@ const OptionViewArtist = withSuspenseMemo<{
IconComponent={IconFA} IconComponent={IconFA}
name="microphone" name="microphone"
size={26} size={26}
text={t('resources.artist.actions.view')} text="View Artist"
onSelect={() => navigation.navigate('artist', { id: artistId, title: artist })} onSelect={() => navigation.navigate('artist', { id: artistId, title: artist })}
/> />
) )
}) })
const OptionViewAlbum = withSuspenseMemo<{ const OptionViewAlbum = React.memo<{
navigation: NavigationProp<any> navigation: NavigationProp<any>
album?: string album?: string
albumId?: string albumId?: string
}>(({ navigation, album, albumId }) => { }>(({ navigation, album, albumId }) => {
const { t } = useTranslation()
if (!album || !albumId) { if (!album || !albumId) {
return <></> return <></>
} }
@@ -234,7 +186,7 @@ const OptionViewAlbum = withSuspenseMemo<{
IconComponent={IconFA5} IconComponent={IconFA5}
name="compact-disc" name="compact-disc"
size={26} size={26}
text={t('resources.album.actions.view')} text="View Album"
onSelect={() => navigation.navigate('album', { id: albumId, title: album })} onSelect={() => navigation.navigate('album', { id: albumId, title: album })}
/> />
) )
@@ -281,7 +233,7 @@ export const SongContextPressable: React.FC<SongContextPressableProps> = props =
return ( return (
<ContextMenu <ContextMenu
{...props} {...props}
menuHeader={<MenuHeader title={song.title} subtitle={song.artist} albumId={song.albumId} />} menuHeader={<MenuHeader title={song.title} subtitle={song.artist} coverArt={song.coverArt} />}
menuOptions={ menuOptions={
<> <>
<OptionStar id={song.id} type={song.itemType} /> <OptionStar id={song.id} type={song.itemType} />
@@ -328,7 +280,7 @@ export const NowPlayingContextPressable: React.FC<NowPlayingContextPressableProp
return ( return (
<ContextMenu <ContextMenu
{...props} {...props}
menuHeader={<MenuHeader title={song.title} subtitle={song.artist} albumId={song.albumId} />} menuHeader={<MenuHeader title={song.title} subtitle={song.artist} coverArt={song.coverArt} />}
menuOptions={ menuOptions={
<> <>
<OptionStar id={song.id} type={song.itemType} /> <OptionStar id={song.id} type={song.itemType} />
@@ -348,8 +300,6 @@ const styles = StyleSheet.create({
}, },
optionsWrapper: { optionsWrapper: {
// marginBottom: 10, // marginBottom: 10,
paddingHorizontal: 20,
// backgroundColor: 'purple',
}, },
menuHeader: { menuHeader: {
paddingTop: 14, paddingTop: 14,
@@ -380,11 +330,9 @@ const styles = StyleSheet.create({
}, },
option: { option: {
paddingVertical: 8, paddingVertical: 8,
// paddingHorizontal: 100, paddingHorizontal: 20,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
// backgroundColor: 'blue',
overflow: 'hidden',
}, },
icon: { icon: {
marginRight: 10, marginRight: 10,
+19 -41
View File
@@ -1,5 +1,5 @@
import { useQueryAlbumCoverArtPath, useQueryArtistArtPath, useQueryCoverArtPath } from '@app/hooks/query' import { useArtistArtFile, useCoverArtFile } from '@app/hooks/cache'
import { CacheImageSize } from '@app/models/cache' import { CacheFile, CacheImageSize, CacheRequest } from '@app/models/cache'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import React, { useState } from 'react' import React, { useState } from 'react'
import { import {
@@ -18,8 +18,7 @@ type BaseProps = {
imageStyle?: ImageStyle imageStyle?: ImageStyle
resizeMode?: ImageResizeMode resizeMode?: ImageResizeMode
round?: boolean round?: boolean
size: CacheImageSize size?: CacheImageSize
fadeDuration?: number
} }
type ArtistCoverArtProps = BaseProps & { type ArtistCoverArtProps = BaseProps & {
@@ -32,68 +31,50 @@ type CoverArtProps = BaseProps & {
coverArt?: string coverArt?: string
} }
type AlbumIdProps = BaseProps & { const ImageSource = React.memo<{ cache?: { file?: CacheFile; request?: CacheRequest } } & BaseProps>(
type: 'album' ({ cache, style, imageStyle, resizeMode }) => {
albumId?: string
}
type ImageSourceProps = BaseProps & {
data?: string
isFetching: boolean
isExistingFetching: boolean
}
const ImageSource = React.memo<ImageSourceProps>(
({ style, imageStyle, resizeMode, data, isFetching, isExistingFetching, fadeDuration }) => {
const [error, setError] = useState(false) const [error, setError] = useState(false)
let source: ImageSourcePropType let source: ImageSourcePropType
if (!error && data) { if (!error && cache?.file && !cache?.request?.promise) {
source = { uri: `file://${data}` } source = { uri: `file://${cache.file.path}`, cache: 'reload' }
} else { } else {
source = require('@res/fallback.png') source = require('@res/fallback.png')
} }
return ( return (
<> <>
{isExistingFetching ? (
<View style={{ height: style?.height, width: style?.width }} />
) : (
<Image <Image
source={source} source={source}
fadeDuration={fadeDuration === undefined ? 250 : fadeDuration} fadeDuration={150}
resizeMode={resizeMode || 'contain'} resizeMode={resizeMode || 'contain'}
style={[{ height: style?.height, width: style?.width }, imageStyle]} style={[{ height: style?.height, width: style?.width }, imageStyle]}
onError={() => setError(true)} onError={() => setError(true)}
/> />
)} <ActivityIndicator
{isFetching && ( animating={!!cache?.request?.promise}
<ActivityIndicator animating={true} size="large" color={colors.accent} style={styles.indicator} /> size="large"
)} color={colors.accent}
style={styles.indicator}
/>
</> </>
) )
}, },
) )
const ArtistImage = React.memo<ArtistCoverArtProps>(props => { const ArtistImage = React.memo<ArtistCoverArtProps>(props => {
const { data, isFetching, isExistingFetching } = useQueryArtistArtPath(props.artistId, props.size) const cache = useArtistArtFile(props.artistId, props.size)
return <ImageSource data={data} isFetching={isFetching} isExistingFetching={isExistingFetching} {...props} /> return <ImageSource cache={cache} {...props} imageStyle={{ ...styles.artistImage, ...props.imageStyle }} />
}) })
const CoverArtImage = React.memo<CoverArtProps>(props => { const CoverArtImage = React.memo<CoverArtProps>(props => {
const { data, isFetching, isExistingFetching } = useQueryCoverArtPath(props.coverArt, props.size) const cache = useCoverArtFile(props.coverArt, props.size)
return <ImageSource data={data} isFetching={isFetching} isExistingFetching={isExistingFetching} {...props} /> return <ImageSource cache={cache} {...props} />
}) })
const AlbumIdIamge = React.memo<AlbumIdProps>(props => { const CoverArt = React.memo<CoverArtProps | ArtistCoverArtProps>(props => {
const { data, isFetching, isExistingFetching } = useQueryAlbumCoverArtPath(props.albumId, props.size)
return <ImageSource data={data} isFetching={isFetching} isExistingFetching={isExistingFetching} {...props} />
})
const CoverArt = React.memo<CoverArtProps | ArtistCoverArtProps | AlbumIdProps>(props => {
const viewStyles = [props.style] const viewStyles = [props.style]
if (props.round) { if (props.round) {
viewStyles.push(styles.round) viewStyles.push(styles.round)
@@ -104,9 +85,6 @@ const CoverArt = React.memo<CoverArtProps | ArtistCoverArtProps | AlbumIdProps>(
case 'artist': case 'artist':
imageComponent = <ArtistImage {...(props as ArtistCoverArtProps)} /> imageComponent = <ArtistImage {...(props as ArtistCoverArtProps)} />
break break
case 'album':
imageComponent = <AlbumIdIamge {...(props as AlbumIdProps)} />
break
default: default:
imageComponent = <CoverArtImage {...(props as CoverArtProps)} /> imageComponent = <CoverArtImage {...(props as CoverArtProps)} />
break break
+21 -51
View File
@@ -1,13 +1,10 @@
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import font from '@app/styles/font' import font from '@app/styles/font'
import React from 'react' import React from 'react'
import { Text, StyleSheet, View } from 'react-native' import { Text, StyleSheet } from 'react-native'
import { MenuOption, Menu, MenuTrigger, MenuOptions, renderers } from 'react-native-popup-menu' import { MenuOption, Menu, MenuTrigger, MenuOptions } from 'react-native-popup-menu'
import PressableOpacity from './PressableOpacity' import PressableOpacity from './PressableOpacity'
import Icon from 'react-native-vector-icons/MaterialCommunityIcons' import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
import { ScrollView } from 'react-native-gesture-handler'
const { SlideInMenu } = renderers
export type OptionData = { export type OptionData = {
value: string value: string
@@ -20,14 +17,12 @@ const Option = React.memo<{
selected?: boolean selected?: boolean
}>(({ text, value, selected }) => ( }>(({ text, value, selected }) => (
<MenuOption style={styles.option} value={value}> <MenuOption style={styles.option} value={value}>
<Text style={styles.optionText}>{text}</Text>
{selected ? ( {selected ? (
<Icon name="checkbox-marked-circle" size={32} color={colors.accent} style={styles.icon} /> <Icon name="checkbox-marked-circle" size={26} color={colors.accent} />
) : ( ) : (
<Icon name="checkbox-blank-circle-outline" size={32} color={colors.text.secondary} style={styles.icon} /> <Icon name="checkbox-blank-circle-outline" size={26} color={colors.text.secondary} />
)} )}
<Text style={styles.optionText} numberOfLines={1} adjustsFontSizeToFit={true} minimumFontScale={0.6}>
{text}
</Text>
</MenuOption> </MenuOption>
)) ))
@@ -35,10 +30,9 @@ const FilterButton = React.memo<{
value?: string value?: string
data: OptionData[] data: OptionData[]
onSelect?: (selection: string) => void onSelect?: (selection: string) => void
title: string }>(({ value, data, onSelect }) => {
}>(({ value, data, onSelect, title }) => {
return ( return (
<Menu onSelect={onSelect} renderer={SlideInMenu}> <Menu onSelect={onSelect}>
<MenuTrigger <MenuTrigger
customStyles={{ customStyles={{
triggerOuterWrapper: styles.filterOuterWrapper, triggerOuterWrapper: styles.filterOuterWrapper,
@@ -46,23 +40,16 @@ const FilterButton = React.memo<{
triggerTouchable: { style: styles.filter }, triggerTouchable: { style: styles.filter },
TriggerTouchableComponent: PressableOpacity, TriggerTouchableComponent: PressableOpacity,
}}> }}>
<Icon name="filter-variant" color="white" size={30} /> <Icon name="filter-variant" color="white" size={30} style={styles.filterIcon} />
</MenuTrigger> </MenuTrigger>
<MenuOptions <MenuOptions
customStyles={{ customStyles={{
optionsWrapper: styles.optionsWrapper, optionsWrapper: styles.optionsWrapper,
optionsContainer: styles.optionsContainer, optionsContainer: styles.optionsContainer,
}}> }}>
<ScrollView style={styles.optionsScroll} overScrollMode="never">
<View style={styles.header}>
<Text style={styles.headerText} numberOfLines={2} ellipsizeMode="clip">
{title}
</Text>
</View>
{data.map(o => ( {data.map(o => (
<Option key={o.value} text={o.text} value={o.value} selected={o.value === value} /> <Option key={o.value} text={o.text} value={o.value} selected={o.value === value} />
))} ))}
</ScrollView>
</MenuOptions> </MenuOptions>
</Menu> </Menu>
) )
@@ -84,45 +71,28 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
backgroundColor: colors.accent, backgroundColor: colors.accent,
}, },
optionsScroll: { filterIcon: {
maxHeight: 260, // top: 4,
}, },
optionsWrapper: { optionsWrapper: {
overflow: 'hidden', maxWidth: 145,
}, },
optionsContainer: { optionsContainer: {
backgroundColor: 'rgba(45, 45, 45, 0.95)', backgroundColor: colors.gradient.high,
}, maxWidth: 145,
header: {
paddingHorizontal: 20,
// paddingVertical: 10,
marginTop: 16,
marginBottom: 6,
},
headerText: {
fontFamily: font.bold,
fontSize: 20,
color: colors.text.primary,
}, },
option: { option: {
paddingVertical: 8,
paddingHorizontal: 20,
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', paddingHorizontal: 12,
justifyContent: 'flex-start', paddingVertical: 8,
},
optionText: {
fontFamily: font.semiBold,
fontSize: 16,
color: colors.text.primary,
},
icon: {
marginRight: 14,
width: 32,
height: 32,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
// backgroundColor: 'red', },
optionText: {
color: colors.text.primary,
fontFamily: font.semiBold,
fontSize: 16,
flex: 1,
}, },
}) })
+1 -3
View File
@@ -4,7 +4,6 @@ import dimensions from '@app/styles/dimensions'
import React, { ForwardedRef, PropsWithChildren } from 'react' import React, { ForwardedRef, PropsWithChildren } from 'react'
import { ScrollView, ScrollViewProps, useWindowDimensions } from 'react-native' import { ScrollView, ScrollViewProps, useWindowDimensions } from 'react-native'
import Animated from 'react-native-reanimated' import Animated from 'react-native-reanimated'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
export type GradientScrollViewProps = PropsWithChildren< export type GradientScrollViewProps = PropsWithChildren<
Animated.AnimateProps<ScrollViewProps> & { Animated.AnimateProps<ScrollViewProps> & {
@@ -14,9 +13,8 @@ export type GradientScrollViewProps = PropsWithChildren<
const GradientScrollView = React.forwardRef<ScrollView, GradientScrollViewProps>((props, ref) => { const GradientScrollView = React.forwardRef<ScrollView, GradientScrollViewProps>((props, ref) => {
const layout = useWindowDimensions() const layout = useWindowDimensions()
const paddingTop = useSafeAreaInsets().top
const minHeight = layout.height - (dimensions.header + paddingTop + dimensions.bottom()) const minHeight = layout.height - (dimensions.top() + dimensions.bottom())
return ( return (
<Animated.ScrollView <Animated.ScrollView
+8 -8
View File
@@ -1,16 +1,15 @@
import { Album, Song } from '@app/models/library'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import dimensions from '@app/styles/dimensions' import dimensions from '@app/styles/dimensions'
import font from '@app/styles/font' import font from '@app/styles/font'
import { useNavigation } from '@react-navigation/core' import { useNavigation } from '@react-navigation/core'
import { ReactComponentLike } from 'prop-types'
import React, { useCallback } from 'react' import React, { useCallback } from 'react'
import { StyleSheet, Text, View, ViewStyle } from 'react-native' import { View, StatusBar, Text, StyleSheet, ViewStyle } from 'react-native'
import Animated from 'react-native-reanimated' import Animated from 'react-native-reanimated'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import IconMat from 'react-native-vector-icons/MaterialIcons'
import { AlbumContextPressable, NowPlayingContextPressable } from './ContextMenu'
import PressableOpacity from './PressableOpacity' import PressableOpacity from './PressableOpacity'
import IconMat from 'react-native-vector-icons/MaterialIcons'
import { ReactComponentLike } from 'prop-types'
import { AlbumContextPressable, NowPlayingContextPressable } from './ContextMenu'
import { Album, Song } from '@app/models/library'
export type HeaderContextItem = Song | Album export type HeaderContextItem = Song | Album
@@ -54,7 +53,6 @@ const HeaderBar = React.memo<{
contextItem?: HeaderContextItem contextItem?: HeaderContextItem
}>(({ title, headerStyle, HeaderCenter, contextItem }) => { }>(({ title, headerStyle, HeaderCenter, contextItem }) => {
const navigation = useNavigation() const navigation = useNavigation()
const top = useSafeAreaInsets().top
const back = useCallback(() => { const back = useCallback(() => {
navigation.goBack() navigation.goBack()
@@ -63,7 +61,7 @@ const HeaderBar = React.memo<{
const _headerStyle = Array.isArray(headerStyle) ? headerStyle : [headerStyle] const _headerStyle = Array.isArray(headerStyle) ? headerStyle : [headerStyle]
return ( return (
<Animated.View style={[styles.container, { paddingTop: top, height: dimensions.header + top }, ..._headerStyle]}> <Animated.View style={[styles.container, ..._headerStyle]}>
<PressableOpacity onPress={back} style={styles.icons}> <PressableOpacity onPress={back} style={styles.icons}>
<IconMat name="arrow-back" color="white" size={25} /> <IconMat name="arrow-back" color="white" size={25} />
</PressableOpacity> </PressableOpacity>
@@ -83,6 +81,8 @@ const HeaderBar = React.memo<{
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
height: dimensions.top(),
paddingTop: StatusBar.currentHeight,
backgroundColor: colors.gradient.high, backgroundColor: colors.gradient.high,
width: '100%', width: '100%',
flexDirection: 'row', flexDirection: 'row',
+1 -3
View File
@@ -3,13 +3,11 @@ import colors from '@app/styles/colors'
import dimensions from '@app/styles/dimensions' import dimensions from '@app/styles/dimensions'
import React from 'react' import React from 'react'
import { ScrollView, ScrollViewProps, useWindowDimensions } from 'react-native' import { ScrollView, ScrollViewProps, useWindowDimensions } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
const ImageGradientScrollView: React.FC<ScrollViewProps & ImageGradientBackgroundProps> = props => { const ImageGradientScrollView: React.FC<ScrollViewProps & ImageGradientBackgroundProps> = props => {
const layout = useWindowDimensions() const layout = useWindowDimensions()
const paddingTop = useSafeAreaInsets().top
const minHeight = layout.height - (dimensions.header + paddingTop + dimensions.bottom()) const minHeight = layout.height - (dimensions.top() + dimensions.bottom())
return ( return (
<ScrollView <ScrollView
+12 -25
View File
@@ -54,8 +54,7 @@ const ListItem: React.FC<{
listStyle?: 'big' | 'small' listStyle?: 'big' | 'small'
subtitle?: string subtitle?: string
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
disabled?: boolean }> = ({ item, contextId, queueId, onPress, showArt, showStar, subtitle, listStyle, style }) => {
}> = ({ item, contextId, queueId, onPress, showArt, showStar, subtitle, listStyle, style, disabled }) => {
const navigation = useNavigation() const navigation = useNavigation()
showStar = showStar === undefined ? true : showStar showStar = showStar === undefined ? true : showStar
@@ -66,13 +65,13 @@ const ListItem: React.FC<{
if (!onPress) { if (!onPress) {
switch (item.itemType) { switch (item.itemType) {
case 'album': case 'album':
onPress = () => navigation.navigate('album', { id: item.id, title: item.name, album: item }) onPress = () => navigation.navigate('album', { id: item.id, title: item.name })
break break
case 'artist': case 'artist':
onPress = () => navigation.navigate('artist', { id: item.id, title: item.name }) onPress = () => navigation.navigate('artist', { id: item.id, title: item.name })
break break
case 'playlist': case 'playlist':
onPress = () => navigation.navigate('playlist', { id: item.id, title: item.name, playlist: item }) onPress = () => navigation.navigate('playlist', { id: item.id, title: item.name })
break break
} }
} }
@@ -91,43 +90,35 @@ const ListItem: React.FC<{
const itemPressable = useCallback( const itemPressable = useCallback(
({ children }) => ( ({ children }) => (
<PressableOpacity onPress={onPress} style={styles.item} disabled={disabled}> <PressableOpacity onPress={onPress} style={styles.item}>
{children} {children}
</PressableOpacity> </PressableOpacity>
), ),
[disabled, onPress], [onPress],
) )
const albumPressable = useCallback( const albumPressable = useCallback(
({ children }) => ( ({ children }) => (
<AlbumContextPressable <AlbumContextPressable album={item as Album} onPress={onPress} triggerWrapperStyle={styles.item}>
album={item as Album}
onPress={onPress}
triggerWrapperStyle={styles.item}
disabled={disabled}>
{children} {children}
</AlbumContextPressable> </AlbumContextPressable>
), ),
[disabled, item, onPress], [item, onPress],
) )
const songPressable = useCallback( const songPressable = useCallback(
({ children }) => ( ({ children }) => (
<SongContextPressable song={item as Song} onPress={onPress} triggerWrapperStyle={styles.item} disabled={disabled}> <SongContextPressable song={item as Song} onPress={onPress} triggerWrapperStyle={styles.item}>
{children} {children}
</SongContextPressable> </SongContextPressable>
), ),
[disabled, item, onPress], [item, onPress],
) )
const artistPressable = useCallback( const artistPressable = useCallback(
({ children }) => ( ({ children }) => (
<ArtistContextPressable <ArtistContextPressable artist={item as Artist} onPress={onPress} triggerWrapperStyle={styles.item}>
artist={item as Artist}
onPress={onPress}
triggerWrapperStyle={styles.item}
disabled={disabled}>
{children} {children}
</ArtistContextPressable> </ArtistContextPressable>
), ),
[disabled, item, onPress], [item, onPress],
) )
let PressableComponent = itemPressable let PressableComponent = itemPressable
@@ -160,10 +151,6 @@ const ListItem: React.FC<{
size="thumbnail" size="thumbnail"
/> />
) )
} else if (item.itemType === 'song') {
coverArt = (
<CoverArt type="album" albumId={item.albumId} style={artStyle} resizeMode={resizeMode} size="thumbnail" />
)
} else { } else {
coverArt = ( coverArt = (
<CoverArt type="cover" coverArt={item.coverArt} style={artStyle} resizeMode={resizeMode} size="thumbnail" /> <CoverArt type="cover" coverArt={item.coverArt} style={artStyle} resizeMode={resizeMode} size="thumbnail" />
@@ -193,7 +180,7 @@ const ListItem: React.FC<{
</PressableComponent> </PressableComponent>
<View style={styles.controls}> <View style={styles.controls}>
{showStar && item.itemType !== 'playlist' && ( {showStar && item.itemType !== 'playlist' && (
<PressableStar id={item.id} type={item.itemType} size={26} style={styles.controlItem} disabled={disabled} /> <PressableStar id={item.id} type={item.itemType} size={26} style={styles.controlItem} />
)} )}
</View> </View>
</View> </View>
+17 -12
View File
@@ -1,23 +1,23 @@
import Button from '@app/components/Button' import Button from '@app/components/Button'
import { Song } from '@app/models/library' import { Song } from '@app/models/library'
import { QueueContextType } from '@app/models/trackplayer'
import { useStore } from '@app/state/store'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import React, { useState } from 'react' import React, { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native' import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
import Icon from 'react-native-vector-icons/Ionicons' import Icon from 'react-native-vector-icons/Ionicons'
import IconMat from 'react-native-vector-icons/MaterialIcons' import IconMat from 'react-native-vector-icons/MaterialIcons'
import { withSuspenseMemo } from './withSuspense'
const ListPlayerControls = withSuspenseMemo<{ const ListPlayerControls = React.memo<{
songs: Song[] songs: Song[]
listType: 'album' | 'playlist' typeName: string
queueName: string
queueContextType: QueueContextType
queueContextId: string
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
play: () => void }>(({ songs, typeName, queueName, queueContextType, queueContextId, style }) => {
shuffle: () => void
disabled?: boolean
}>(({ listType, style, play, shuffle, disabled }) => {
const [downloaded, setDownloaded] = useState(false) const [downloaded, setDownloaded] = useState(false)
const { t } = useTranslation() const setQueue = useStore(store => store.setQueue)
return ( return (
<View style={[styles.controls, style]}> <View style={[styles.controls, style]}>
@@ -34,10 +34,16 @@ const ListPlayerControls = withSuspenseMemo<{
</Button> </Button>
</View> </View>
<View style={styles.controlsCenter}> <View style={styles.controlsCenter}>
<Button title={t(`resources.${listType}.actions.play`)} disabled={disabled} onPress={play} /> <Button
title={`Play ${typeName}`}
disabled={songs.length === 0}
onPress={() => setQueue(songs, queueName, queueContextType, queueContextId, undefined, false)}
/>
</View> </View>
<View style={styles.controlsSide}> <View style={styles.controlsSide}>
<Button disabled={disabled} onPress={shuffle}> <Button
disabled={songs.length === 0}
onPress={() => setQueue(songs, queueName, queueContextType, queueContextId, undefined, true)}>
<Icon name="shuffle" size={26} color="white" /> <Icon name="shuffle" size={26} color="white" />
</Button> </Button>
</View> </View>
@@ -58,7 +64,6 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
maxWidth: '65%',
}, },
}) })
+2 -7
View File
@@ -1,25 +1,20 @@
import font from '@app/styles/font' import font from '@app/styles/font'
import React from 'react' import React from 'react'
import { useTranslation } from 'react-i18next'
import { Text, View, StyleSheet, ViewStyle } from 'react-native' import { Text, View, StyleSheet, ViewStyle } from 'react-native'
import Icon from 'react-native-vector-icons/MaterialCommunityIcons' import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
import { withSuspenseMemo } from './withSuspense'
const NothingHere = withSuspenseMemo<{ const NothingHere = React.memo<{
height?: number height?: number
width?: number width?: number
style?: ViewStyle style?: ViewStyle
}>(({ height, width, style }) => { }>(({ height, width, style }) => {
const { t } = useTranslation()
height = height || 200 height = height || 200
width = width || 200 width = width || 200
return ( return (
<View style={[styles.container, { height, width }, style]}> <View style={[styles.container, { height, width }, style]}>
<Icon name="music-rest-quarter" color={styles.text.color} size={width / 2} /> <Icon name="music-rest-quarter" color={styles.text.color} size={width / 2} />
<Text style={[styles.text, { fontSize: width / 8 }]} numberOfLines={3}> <Text style={[styles.text, { fontSize: width / 8 }]}>Nothing here...</Text>
{t('messages.nothingHere')}
</Text>
</View> </View>
) )
}) })
+3 -5
View File
@@ -79,7 +79,7 @@ const Controls = React.memo(() => {
const NowPlayingBar = React.memo(() => { const NowPlayingBar = React.memo(() => {
const navigation = useNavigation() const navigation = useNavigation()
const currentTrackExists = useStore(store => !!store.currentTrack) const currentTrackExists = useStore(store => !!store.currentTrack)
const albumId = useStore(store => store.currentTrack?.albumId) const coverArt = useStore(store => store.currentTrack?.coverArt)
const title = useStore(store => store.currentTrack?.title) const title = useStore(store => store.currentTrack?.title)
const artist = useStore(store => store.currentTrack?.artist) const artist = useStore(store => store.currentTrack?.artist)
@@ -90,11 +90,9 @@ const NowPlayingBar = React.memo(() => {
<ProgressBar /> <ProgressBar />
<View style={styles.subContainer}> <View style={styles.subContainer}>
<CoverArt <CoverArt
type="album" type="cover"
style={{ height: styles.subContainer.height, width: styles.subContainer.height }} style={{ height: styles.subContainer.height, width: styles.subContainer.height }}
albumId={albumId} coverArt={coverArt}
size="thumbnail"
fadeDuration={0}
/> />
<View style={styles.detailsContainer}> <View style={styles.detailsContainer}>
<Text numberOfLines={1} style={styles.detailsTitle}> <Text numberOfLines={1} style={styles.detailsTitle}>
+8 -4
View File
@@ -1,5 +1,5 @@
import React, { useCallback, useState } from 'react' import React, { useCallback, useEffect, useState } from 'react'
import { GestureResponderEvent, LayoutRectangle, Pressable, PressableProps, StyleSheet } from 'react-native' import { GestureResponderEvent, LayoutRectangle, Pressable, PressableProps, ViewStyle, StyleSheet } from 'react-native'
type PressableOpacityProps = PressableProps & { type PressableOpacityProps = PressableProps & {
ripple?: boolean ripple?: boolean
@@ -9,8 +9,13 @@ type PressableOpacityProps = PressableProps & {
const PressableOpacity: React.FC<PressableOpacityProps> = props => { const PressableOpacity: React.FC<PressableOpacityProps> = props => {
const [opacity, setOpacity] = useState(1) const [opacity, setOpacity] = useState(1)
const [disabledStyle, setDisabledStyle] = useState<ViewStyle>({})
const [dimensions, setDimensions] = useState<LayoutRectangle | undefined>(undefined) const [dimensions, setDimensions] = useState<LayoutRectangle | undefined>(undefined)
useEffect(() => {
props.disabled === true ? setDisabledStyle({ opacity: 0.3 }) : setDisabledStyle({})
}, [props.disabled])
props = { props = {
...props, ...props,
unstable_pressDelay: props.unstable_pressDelay === undefined ? 60 : props.unstable_pressDelay, unstable_pressDelay: props.unstable_pressDelay === undefined ? 60 : props.unstable_pressDelay,
@@ -50,8 +55,7 @@ const PressableOpacity: React.FC<PressableOpacityProps> = props => {
return ( return (
<Pressable <Pressable
{...props} {...props}
// eslint-disable-next-line react-native/no-inline-styles style={[styles.pressable, props.style as any, { opacity }, disabledStyle]}
style={[styles.pressable, props.style as any, { opacity }, props.disabled ? { opacity: 0.3 } : {}]}
android_ripple={ android_ripple={
props.ripple props.ripple
? { ? {
+5 -6
View File
@@ -1,4 +1,4 @@
import { useStar } from '@app/hooks/query' import { useStar } from '@app/hooks/library'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import React from 'react' import React from 'react'
import { PressableStateCallbackType, StyleProp, ViewStyle } from 'react-native' import { PressableStateCallbackType, StyleProp, ViewStyle } from 'react-native'
@@ -19,13 +19,12 @@ export const PressableStar = React.memo<{
type: 'album' | 'artist' | 'song' type: 'album' | 'artist' | 'song'
size: number size: number
style?: StyleProp<ViewStyle> | ((state: PressableStateCallbackType) => StyleProp<ViewStyle>) | undefined style?: StyleProp<ViewStyle> | ((state: PressableStateCallbackType) => StyleProp<ViewStyle>) | undefined
disabled?: boolean }>(({ id, type, size, style }) => {
}>(({ id, type, size, style, disabled }) => { const { starred, toggleStar } = useStar(id, type)
const { query, toggle } = useStar(id, type)
return ( return (
<PressableOpacity onPress={() => toggle.mutate()} style={style} disabled={disabled}> <PressableOpacity onPress={toggleStar} style={style}>
<Star size={size} starred={!!query.data} /> <Star size={size} starred={starred} />
</PressableOpacity> </PressableOpacity>
) )
}) })
-32
View File
@@ -1,32 +0,0 @@
import React, { ComponentType, FunctionComponent, Suspense, SuspenseProps } from 'react'
export function withSuspense<P extends string | number | object>(
WrappedComponent: ComponentType<P>,
fallback: SuspenseProps['fallback'] = null,
): FunctionComponent<P> {
function ComponentWithSuspense(props: P) {
return (
<Suspense fallback={fallback}>
<WrappedComponent {...props} />
</Suspense>
)
}
return ComponentWithSuspense
}
export function withSuspenseMemo<P extends string | number | object>(
WrappedComponent: ComponentType<P>,
fallback: SuspenseProps['fallback'] = null,
propsAreEqual?: Parameters<typeof React.memo>['1'],
) {
function ComponentWithSuspense(props: P) {
return (
<Suspense fallback={fallback}>
<WrappedComponent {...props} />
</Suspense>
)
}
return React.memo(ComponentWithSuspense, propsAreEqual)
}
+81
View File
@@ -0,0 +1,81 @@
import { CacheImageSize, CacheItemTypeKey } from '@app/models/cache'
import { Store, useStore, useStoreDeep } from '@app/state/store'
import { useCallback, useEffect } from 'react'
const useFileRequest = (key: CacheItemTypeKey, id: string) => {
const file = useStore(
useCallback(
(store: Store) => {
const activeServerId = store.settings.activeServerId
if (!activeServerId) {
return
}
return store.cacheFiles[activeServerId][key][id]
},
[key, id],
),
)
const request = useStore(
useCallback(
(store: Store) => {
const activeServerId = store.settings.activeServerId
if (!activeServerId) {
return
}
return store.cacheRequests[activeServerId][key][id]
},
[key, id],
),
)
return { file, request }
}
export const useCoverArtFile = (coverArt = '-1', size: CacheImageSize = 'thumbnail') => {
const type: CacheItemTypeKey = size === 'original' ? 'coverArt' : 'coverArtThumb'
const { file, request } = useFileRequest(type, coverArt)
const client = useStore(store => store.client)
const cacheItem = useStore(store => store.cacheItem)
useEffect(() => {
if (!file && client) {
cacheItem(type, coverArt, () =>
client.getCoverArtUri({
id: coverArt,
size: type === 'coverArtThumb' ? '256' : undefined,
}),
)
}
// intentionally leaving file out so it doesn't re-render if the request fails
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [cacheItem, client, coverArt, type])
return { file, request }
}
export const useArtistArtFile = (artistId: string, size: CacheImageSize = 'thumbnail') => {
const type: CacheItemTypeKey = size === 'original' ? 'artistArt' : 'artistArtThumb'
const fetchArtistInfo = useStore(store => store.fetchArtistInfo)
const artistInfo = useStoreDeep(store => store.library.artistInfo[artistId])
const { file, request } = useFileRequest(type, artistId)
const cacheItem = useStore(store => store.cacheItem)
useEffect(() => {
if (!artistInfo) {
fetchArtistInfo(artistId)
return
}
if (!file && artistInfo) {
cacheItem(type, artistId, async () => {
return type === 'artistArtThumb' ? artistInfo?.smallImageUrl : artistInfo?.largeImageUrl
})
}
// intentionally leaving file out so it doesn't re-render if the request fails
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [artistId, cacheItem, fetchArtistInfo, type, artistInfo])
return { file, request }
}
-315
View File
@@ -1,315 +0,0 @@
import { CacheItemTypeKey } from '@app/models/cache'
import { Album, Playlist, Song } from '@app/models/library'
import { mapAlbum, mapArtist, mapArtistInfo, mapPlaylist, mapSong } from '@app/models/map'
import queryClient from '@app/queryClient'
import { useStore } from '@app/state/store'
import { SubsonicApiClient } from '@app/subsonic/api'
import { GetAlbumList2TypeBase, Search3Params, StarParams } from '@app/subsonic/params'
import { cacheDir } from '@app/util/fs'
import { mapCollectionById } from '@app/util/state'
import userAgent from '@app/util/userAgent'
import cd from 'content-disposition'
import mime from 'mime-types'
import path from 'path'
import ReactNativeBlobUtil, { FetchBlobResponse } from 'react-native-blob-util'
import RNFS from 'react-native-fs'
import qk from './queryKeys'
export const useClient = () => {
const client = useStore(store => store.client)
return () => {
if (!client) {
throw new Error('no client!')
}
return client
}
}
function cacheStarredData<T extends { id: string; starred?: undefined | any }>(item: T) {
queryClient.setQueryData<boolean>(qk.starredItems(item.id), !!item.starred)
}
function cacheAlbumCoverArtData<T extends { id: string; coverArt?: string }>(item: T) {
queryClient.setQueryData<string | undefined>(qk.albumCoverArt(item.id), item.coverArt)
}
export const useFetchArtists = () => {
const client = useClient()
return async () => {
const res = await client().getArtists()
res.data.artists.forEach(cacheStarredData)
return mapCollectionById(res.data.artists, mapArtist)
}
}
export const useFetchArtist = () => {
const client = useClient()
return async (id: string) => {
const res = await client().getArtist({ id })
cacheStarredData(res.data.artist)
res.data.albums.forEach(cacheStarredData)
res.data.albums.forEach(cacheAlbumCoverArtData)
return {
artist: mapArtist(res.data.artist),
albums: res.data.albums.map(mapAlbum),
}
}
}
export const useFetchArtistInfo = () => {
const client = useClient()
return async (id: string) => {
const res = await client().getArtistInfo2({ id })
return mapArtistInfo(id, res.data.artistInfo)
}
}
export const useFetchArtistTopSongs = () => {
const client = useClient()
return async (artistName: string) => {
const res = await client().getTopSongs({ artist: artistName })
res.data.songs.forEach(cacheStarredData)
return res.data.songs.map(mapSong)
}
}
export const useFetchPlaylists = () => {
const client = useClient()
return async () => {
const res = await client().getPlaylists()
return mapCollectionById(res.data.playlists, mapPlaylist)
}
}
export const useFetchPlaylist = () => {
const client = useClient()
return async (id: string): Promise<{ playlist: Playlist; songs?: Song[] }> => {
const res = await client().getPlaylist({ id })
res.data.playlist.songs.forEach(cacheStarredData)
return {
playlist: mapPlaylist(res.data.playlist),
songs: res.data.playlist.songs.map(mapSong),
}
}
}
export async function fetchAlbum(id: string, client: SubsonicApiClient): Promise<{ album: Album; songs?: Song[] }> {
const res = await client.getAlbum({ id })
cacheStarredData(res.data.album)
res.data.songs.forEach(cacheStarredData)
cacheAlbumCoverArtData(res.data.album)
return {
album: mapAlbum(res.data.album),
songs: res.data.songs.map(mapSong),
}
}
export const useFetchAlbum = () => {
const client = useClient()
return async (id: string) => fetchAlbum(id, client())
}
export const useFetchAlbumList = () => {
const client = useClient()
return async (size: number, offset: number, type: GetAlbumList2TypeBase) => {
const res = await client().getAlbumList2({ size, offset, type })
res.data.albums.forEach(cacheStarredData)
res.data.albums.forEach(cacheAlbumCoverArtData)
return res.data.albums.map(mapAlbum)
}
}
export const useFetchSong = () => {
const client = useClient()
return async (id: string) => {
const res = await client().getSong({ id })
cacheStarredData(res.data.song)
return mapSong(res.data.song)
}
}
export const useFetchSearchResults = () => {
const client = useClient()
return async (params: Search3Params) => {
const res = await client().search3(params)
res.data.artists.forEach(cacheStarredData)
res.data.albums.forEach(cacheStarredData)
res.data.songs.forEach(cacheStarredData)
res.data.albums.forEach(cacheAlbumCoverArtData)
return {
artists: res.data.artists.map(mapArtist),
albums: res.data.albums.map(mapAlbum),
songs: res.data.songs.map(mapSong),
}
}
}
export const useFetchStar = () => {
const client = useClient()
return async (params: StarParams) => {
await client().star(params)
return
}
}
export const useFetchUnstar = () => {
const client = useClient()
return async (params: StarParams) => {
await client().unstar(params)
return
}
}
export type FetchExisingFileOptions = {
itemType: CacheItemTypeKey
itemId: string
}
export async function fetchExistingFile(
options: FetchExisingFileOptions,
serverId: string | undefined,
): Promise<string | undefined> {
const { itemType, itemId } = options
const fileDir = cacheDir(serverId, itemType, itemId)
try {
const dir = await RNFS.readDir(fileDir)
console.log('existing file:', dir[0].path)
return dir[0].path
} catch {}
}
export const useFetchExistingFile = () => {
const serverId = useStore(store => store.settings.activeServerId)
return async (options: FetchExisingFileOptions) => fetchExistingFile(options, serverId)
}
function assertMimeType(expected?: string, actual?: string) {
expected = expected?.toLowerCase()
actual = actual?.toLowerCase()
if (!expected || expected === actual) {
return
}
if (!expected.includes(';')) {
actual = actual?.split(';')[0]
}
if (!expected.includes('/')) {
actual = actual?.split('/')[0]
}
if (expected !== actual) {
throw new Error(`Request does not satisfy expected content type. Expected: ${expected} Actual: ${actual}`)
}
}
export type FetchFileOptions = FetchExisingFileOptions & {
fromUrl: string
useCacheBuster?: boolean
expectedContentType?: string
progress?: (received: number, total: number) => void
}
export async function fetchFile(options: FetchFileOptions, serverId: string | undefined): Promise<string> {
let { itemType, itemId, fromUrl, useCacheBuster, expectedContentType, progress } = options
useCacheBuster = useCacheBuster === undefined ? true : useCacheBuster
const fileDir = cacheDir(serverId, itemType, itemId)
const filePathNoExt = path.join(fileDir, useCacheBuster ? useStore.getState().settings.cacheBuster : itemType)
try {
await RNFS.unlink(fileDir)
} catch {}
const headers = { 'User-Agent': userAgent }
// we send a HEAD first for two reasons:
// 1. to follow any redirects and get the actual URL (DownloadManager does not support redirects)
// 2. to obtain the mime-type up front so we can use it for the file extension/validation
const headRes = await fetch(fromUrl, { method: 'HEAD', headers })
if (headRes.status > 399) {
throw new Error(`HTTP status error ${headRes.status}. File: ${itemType} ID: ${itemId}`)
}
const contentType = headRes.headers.get('content-type') || undefined
assertMimeType(expectedContentType, contentType)
const contentDisposition = headRes.headers.get('content-disposition') || undefined
const filename = contentDisposition ? cd.parse(contentDisposition).parameters.filename : undefined
let extension: string | undefined
if (filename) {
extension = path.extname(filename) || undefined
if (extension) {
extension = extension.substring(1)
}
} else if (contentType) {
extension = mime.extension(contentType) || undefined
}
const config = ReactNativeBlobUtil.config({
addAndroidDownloads: {
useDownloadManager: true,
notification: false,
mime: contentType,
description: 'subtracks',
path: extension ? `${filePathNoExt}.${extension}` : filePathNoExt,
},
})
const fetchParams: Parameters<typeof config['fetch']> = ['GET', headRes.url, headers]
let res: FetchBlobResponse
if (progress) {
res = await config.fetch(...fetchParams).progress(progress)
} else {
res = await config.fetch(...fetchParams)
}
const downloadPath = res.path()
queryClient.setQueryData<string>(qk.existingFiles(itemType, itemId), downloadPath)
console.log('downloaded file:', downloadPath)
return downloadPath
}
export const useFetchFile = () => {
const serverId = useStore(store => store.settings.activeServerId)
return async (options: FetchFileOptions) => fetchFile(options, serverId)
}
+63
View File
@@ -0,0 +1,63 @@
import { useStore } from '@app/state/store'
import { StarParams } from '@app/subsonic/params'
import { useCallback, useEffect } from 'react'
type StarrableItem = 'album' | 'artist' | 'song'
function starParams(id: string, type: StarrableItem): StarParams {
const params: StarParams = {}
if (type === 'album') {
params.albumId = id
} else if (type === 'artist') {
params.artistId = id
} else {
params.id = id
}
return params
}
export const useStar = (id: string, type: StarrableItem) => {
const fetchAlbum = useStore(store => store.fetchAlbum)
const fetchArtist = useStore(store => store.fetchArtist)
const fetchSong = useStore(store => store.fetchSong)
const _starred = useStore(
useCallback(
store => {
if (type === 'album') {
return store.library.albums[id] ? !!store.library.albums[id].starred : null
} else if (type === 'artist') {
return store.library.artists[id] ? !!store.library.artists[id].starred : null
} else {
return store.library.songs[id] ? !!store.library.songs[id].starred : null
}
},
[id, type],
),
)
useEffect(() => {
if (_starred === null) {
if (type === 'album') {
fetchAlbum(id)
} else if (type === 'artist') {
fetchArtist(id)
} else {
fetchSong(id)
}
}
}, [fetchAlbum, fetchArtist, fetchSong, id, _starred, type])
const starred = !!_starred
const _star = useStore(store => store.star)
const _unstar = useStore(store => store.unstar)
const star = useCallback(() => _star(starParams(id, type)), [_star, id, type])
const unstar = useCallback(() => _unstar(starParams(id, type)), [_unstar, id, type])
const toggleStar = useCallback(() => (starred ? unstar() : star()), [star, starred, unstar])
return { star, unstar, toggleStar, starred }
}
+95
View File
@@ -0,0 +1,95 @@
import { useState, useCallback } from 'react'
import { useActiveServerRefresh } from './settings'
export const useFetchList = <T>(fetchList: () => Promise<T[]>) => {
const [list, setList] = useState<T[]>([])
const [refreshing, setRefreshing] = useState(false)
const refresh = useCallback(() => {
setRefreshing(true)
fetchList().then(items => {
setList(items)
setRefreshing(false)
})
}, [fetchList])
const reset = useCallback(() => {
setList([])
refresh()
}, [refresh])
useActiveServerRefresh(
useCallback(() => {
reset()
}, [reset]),
)
return { list, refreshing, refresh, reset }
}
export const useFetchList2 = (fetchList: () => Promise<void>) => {
const [refreshing, setRefreshing] = useState(false)
const refresh = useCallback(async () => {
setRefreshing(true)
await fetchList()
setRefreshing(false)
}, [fetchList])
useActiveServerRefresh(
useCallback(async () => {
await refresh()
}, [refresh]),
)
return { refreshing, refresh }
}
export const useFetchPaginatedList = <T>(
fetchList: (size: number, offset: number) => Promise<T[]>,
pageSize: number,
) => {
const [list, setList] = useState<T[]>([])
const [refreshing, setRefreshing] = useState(false)
const [offset, setOffset] = useState(0)
const refresh = useCallback(() => {
setOffset(0)
setRefreshing(true)
fetchList(pageSize, 0).then(firstPage => {
setList(firstPage)
setRefreshing(false)
})
}, [fetchList, pageSize])
const reset = useCallback(() => {
setList([])
refresh()
}, [refresh])
useActiveServerRefresh(
useCallback(() => {
refresh()
}, [refresh]),
)
const fetchNextPage = useCallback(() => {
const newOffset = offset + pageSize
setRefreshing(true)
fetchList(pageSize, newOffset).then(nextPage => {
setRefreshing(false)
if (nextPage.length === 0) {
return
}
setList([...list, ...nextPage])
setOffset(newOffset)
})
}, [offset, pageSize, fetchList, list])
return { list, refreshing, refresh, reset, fetchNextPage }
}
-323
View File
@@ -1,323 +0,0 @@
import { CacheImageSize, CacheItemTypeKey } from '@app/models/cache'
import { Album, Artist, Playlist, Song, StarrableItemType } from '@app/models/library'
import { CollectionById } from '@app/models/state'
import queryClient from '@app/queryClient'
import { useStore } from '@app/state/store'
import { GetAlbumList2TypeBase, Search3Params, StarParams } from '@app/subsonic/params'
import _ from 'lodash'
import { useInfiniteQuery, useMutation, useQueries, useQuery } from 'react-query'
import {
useFetchAlbum,
useFetchAlbumList,
useFetchArtist,
useFetchArtistInfo,
useFetchArtists,
useFetchArtistTopSongs,
useFetchExistingFile,
useFetchFile,
useFetchPlaylist,
useFetchPlaylists,
useFetchSearchResults,
useFetchSong,
useFetchStar,
useFetchUnstar,
} from './fetch'
import qk from './queryKeys'
export const useQueryArtists = () => useQuery(qk.artists, useFetchArtists())
export const useQueryArtist = (id: string) => {
const fetchArtist = useFetchArtist()
return useQuery(qk.artist(id), () => fetchArtist(id), {
placeholderData: () => {
const artist = queryClient.getQueryData<CollectionById<Artist>>(qk.artists)?.byId[id]
if (artist) {
return { artist, albums: [] }
}
},
})
}
export const useQueryArtistInfo = (id: string) => {
const fetchArtistInfo = useFetchArtistInfo()
return useQuery(qk.artistInfo(id), () => fetchArtistInfo(id))
}
export const useQueryArtistTopSongs = (artistName?: string) => {
const fetchArtistTopSongs = useFetchArtistTopSongs()
const query = useQuery(qk.artistTopSongs(artistName || ''), () => fetchArtistTopSongs(artistName as string), {
enabled: !!artistName,
retry: false,
staleTime: Infinity,
cacheTime: Infinity,
notifyOnChangeProps: ['data', 'isError', 'isFetched', 'isSuccess', 'isFetching'],
})
const querySuccess = query.isFetched && query.isSuccess && query.data && query.data.length > 0
const fetchSearchResults = useFetchSearchResults()
const [artistCount, albumCount, songCount] = [0, 0, 300]
const backupQuery = useQuery(
qk.search(artistName || '', artistCount, albumCount, songCount),
() => fetchSearchResults({ query: artistName as string, artistCount, albumCount, songCount }),
{
select: data => {
const artistNameLower = artistName?.toLowerCase()
const songs = data.songs.filter(s => s.artist?.toLowerCase() === artistNameLower)
// sortBy is a stable sort, so that this doesn't change order arbitrarily and re-render
return _.sortBy(songs, [
s => -(s.playCount || 0),
s => -(s.averageRating || 0),
s => -(s.userRating || 0),
]).slice(0, 50)
},
enabled: !!artistName && !query.isFetching && !querySuccess,
staleTime: Infinity,
cacheTime: Infinity,
notifyOnChangeProps: ['data', 'isError'],
},
)
return querySuccess ? query : backupQuery
}
export const useQueryPlaylists = () => useQuery(qk.playlists, useFetchPlaylists())
export const useQueryPlaylist = (id: string, placeholderPlaylist?: Playlist) => {
const fetchPlaylist = useFetchPlaylist()
const query = useQuery(qk.playlist(id), () => fetchPlaylist(id), {
placeholderData: () => {
if (placeholderPlaylist) {
return { playlist: placeholderPlaylist }
}
const playlist = queryClient.getQueryData<CollectionById<Playlist>>(qk.playlists)?.byId[id]
if (playlist) {
return { playlist, songs: [] }
}
},
})
return query
}
export const useQueryAlbum = (id: string, placeholderAlbum?: Album) => {
const fetchAlbum = useFetchAlbum()
const query = useQuery(qk.album(id), () => fetchAlbum(id), {
placeholderData: (): { album: Album; songs?: Song[] } | undefined =>
placeholderAlbum ? { album: placeholderAlbum } : undefined,
})
return query
}
export const useQueryAlbumList = (type: GetAlbumList2TypeBase, size: number) => {
const fetchAlbumList = useFetchAlbumList()
return useInfiniteQuery(
qk.albumList(type, size),
async context => {
return await fetchAlbumList(size, context.pageParam || 0, type)
},
{
getNextPageParam: (lastPage, allPages) => {
if (lastPage.length === 0) {
return
}
return allPages.length * size
},
cacheTime: 0,
},
)
}
export const useQuerySearchResults = (params: Search3Params) => {
const fetchSearchResults = useFetchSearchResults()
const query = useInfiniteQuery(
qk.search(params.query, params.artistCount, params.albumCount, params.songCount),
async context => {
return await fetchSearchResults({
...params,
artistOffset: context.pageParam?.artistOffset || 0,
albumOffset: context.pageParam?.albumOffset || 0,
songOffset: context.pageParam?.songOffset || 0,
})
},
{
getNextPageParam: (lastPage, allPages) => {
if (lastPage.albums.length + lastPage.artists.length + lastPage.songs.length === 0) {
return
}
return {
artistOffset: allPages.reduce((acc, val) => (acc += val.artists.length), 0),
albumOffset: allPages.reduce((acc, val) => (acc += val.albums.length), 0),
songOffset: allPages.reduce((acc, val) => (acc += val.songs.length), 0),
}
},
cacheTime: 1000 * 60,
enabled: !!params.query && params.query.length > 1,
},
)
return query
}
export const useQueryHomeLists = (types: GetAlbumList2TypeBase[], size: number) => {
const fetchAlbumList = useFetchAlbumList()
const listQueries = useQueries(
types.map(type => {
return {
queryKey: qk.albumList(type, size),
queryFn: async () => {
const albums = await fetchAlbumList(size, 0, type as GetAlbumList2TypeBase)
return { type, albums }
},
}
}),
)
return listQueries
}
export const useStar = (id: string, type: StarrableItemType) => {
const fetchStar = useFetchStar()
const fetchUnstar = useFetchUnstar()
const fetchSong = useFetchSong()
const fetchAlbum = useFetchAlbum()
const fetchArtist = useFetchArtist()
const query = useQuery(
qk.starredItems(id),
async () => {
switch (type) {
case 'album':
console.log('fetch album starred', id)
return !!(await fetchAlbum(id)).album.starred
case 'artist':
console.log('fetch artist starred', id)
return !!(await fetchArtist(id)).artist.starred
default:
console.log('fetch song starred', id)
return !!(await fetchSong(id)).starred
}
},
{
cacheTime: Infinity,
staleTime: Infinity,
},
)
const toggle = useMutation(
() => {
const params: StarParams = {
id: type === 'song' ? id : undefined,
albumId: type === 'album' ? id : undefined,
artistId: type === 'artist' ? id : undefined,
}
return !query.data ? fetchStar(params) : fetchUnstar(params)
},
{
onMutate: () => {
queryClient.setQueryData<boolean>(qk.starredItems(id), !query.data)
},
onSuccess: () => {
if (type === 'album') {
queryClient.invalidateQueries(qk.albumList('starred'))
}
},
},
)
return { query, toggle }
}
export const useQueryExistingFile = (itemType: CacheItemTypeKey, itemId: string) => {
const fetchExistingFile = useFetchExistingFile()
return useQuery(qk.existingFiles(itemType, itemId), () => fetchExistingFile({ itemType, itemId }), {
staleTime: Infinity,
cacheTime: Infinity,
notifyOnChangeProps: ['data', 'isFetched'],
})
}
export const useQueryCoverArtPath = (coverArt = '-1', size: CacheImageSize = 'thumbnail') => {
const fetchFile = useFetchFile()
const client = useStore(store => store.client)
const itemType: CacheItemTypeKey = size === 'original' ? 'coverArt' : 'coverArtThumb'
const existing = useQueryExistingFile(itemType, coverArt)
const query = useQuery(
qk.coverArt(coverArt, size),
async () => {
if (!client) {
return
}
const fromUrl = client.getCoverArtUri({ id: coverArt, size: itemType === 'coverArtThumb' ? '256' : undefined })
return await fetchFile({ itemType, itemId: coverArt, fromUrl, expectedContentType: 'image' })
},
{
enabled: existing.isFetched && !existing.data && !!client,
staleTime: Infinity,
cacheTime: Infinity,
},
)
return { ...query, data: existing.data || query.data, isExistingFetching: existing.isFetching }
}
export const useQueryArtistArtPath = (artistId: string, size: CacheImageSize = 'thumbnail') => {
const fetchFile = useFetchFile()
const client = useStore(store => store.client)
const { data: artistInfo } = useQueryArtistInfo(artistId)
const itemType: CacheItemTypeKey = size === 'original' ? 'artistArt' : 'artistArtThumb'
const existing = useQueryExistingFile(itemType, artistId)
const query = useQuery(
qk.artistArt(artistId, size),
async () => {
if (!client || !artistInfo?.smallImageUrl || !artistInfo?.largeImageUrl) {
return
}
const fromUrl = itemType === 'artistArtThumb' ? artistInfo.smallImageUrl : artistInfo.largeImageUrl
return await fetchFile({ itemType, itemId: artistId, fromUrl, expectedContentType: 'image' })
},
{
enabled:
existing.isFetched &&
!existing.data &&
!!client &&
(!!artistInfo?.smallImageUrl || !!artistInfo?.largeImageUrl),
staleTime: Infinity,
cacheTime: Infinity,
},
)
return { ...query, data: existing.data || query.data, isExistingFetching: existing.isFetching }
}
export const useQueryAlbumCoverArtPath = (albumId?: string, size: CacheImageSize = 'thumbnail') => {
const fetchAlbum = useFetchAlbum()
const query = useQuery(
qk.albumCoverArt(albumId || '-1'),
async () => (await fetchAlbum(albumId || '-1')).album.coverArt,
{
enabled: !!albumId,
staleTime: Infinity,
cacheTime: Infinity,
},
)
return useQueryCoverArtPath(query.data, size)
}
-52
View File
@@ -1,52 +0,0 @@
import { CacheImageSize, CacheItemTypeKey } from '@app/models/cache'
import { GetAlbumList2TypeBase } from '@app/subsonic/params'
const qk = {
starredItems: (id: string) => ['starredItems', id],
albumCoverArt: (id: string) => ['albumCoverArt', id],
artists: 'artists',
artist: (id: string) => ['artist', id],
artistInfo: (id: string) => ['artistInfo', id],
artistTopSongs: (artistName: string) => ['artistTopSongs', artistName],
playlists: 'playlists',
playlist: (id: string) => ['playlist', id],
album: (id: string) => ['album', id],
albumList: (type: GetAlbumList2TypeBase, size?: number) => {
const key: (string | number)[] = ['albumList', type]
size !== undefined && key.push(size)
return key
},
search: (query: string, artistCount?: number, albumCount?: number, songCount?: number) => [
'search',
query,
artistCount,
albumCount,
songCount,
],
coverArt: (coverArt?: string, size?: CacheImageSize) => {
const key: string[] = ['coverArt']
coverArt !== undefined && key.push(coverArt)
size !== undefined && key.push(size)
return key
},
artistArt: (artistId?: string, size?: CacheImageSize) => {
const key: string[] = ['artistArt']
artistId !== undefined && key.push(artistId)
size !== undefined && key.push(size)
return key
},
existingFiles: (type?: CacheItemTypeKey, itemId?: string) => {
const key: string[] = ['existingFiles']
type !== undefined && key.push(type)
itemId !== undefined && key.push(itemId)
return key
},
}
export default qk
+12 -55
View File
@@ -1,10 +1,6 @@
import { useReset } from '@app/hooks/trackplayer' import { useReset } from '@app/hooks/trackplayer'
import { CacheItemTypeKey } from '@app/models/cache' import { useStore } from '@app/state/store'
import queryClient from '@app/queryClient' import { useEffect } from 'react'
import { useStore, useStoreDeep } from '@app/state/store'
import { cacheDir } from '@app/util/fs'
import RNFS from 'react-native-fs'
import qk from './queryKeys'
export const useSwitchActiveServer = () => { export const useSwitchActiveServer = () => {
const activeServerId = useStore(store => store.settings.activeServerId) const activeServerId = useStore(store => store.settings.activeServerId)
@@ -16,60 +12,21 @@ export const useSwitchActiveServer = () => {
return return
} }
await queryClient.cancelQueries(undefined, { active: true })
await resetPlayer() await resetPlayer()
queryClient.removeQueries()
setActiveServer(id) setActiveServer(id)
} }
} }
export const useActiveServerRefresh = (refresh: () => void) => {
const activeServerId = useStore(store => store.settings.activeServerId)
useEffect(() => {
if (activeServerId) {
refresh()
}
}, [activeServerId, refresh])
}
export const useFirstRun = () => { export const useFirstRun = () => {
return useStore(store => Object.keys(store.settings.servers).length === 0) return useStore(store => Object.keys(store.settings.servers).length === 0)
} }
export const useResetImageCache = () => {
const serverIds = useStoreDeep(store => Object.keys(store.settings.servers))
const changeCacheBuster = useStore(store => store.changeCacheBuster)
const setDisableMusicTabs = useStore(store => store.setDisableMusicTabs)
return async () => {
setDisableMusicTabs(true)
try {
// disable/invalidate queries
await Promise.all([
queryClient.cancelQueries(qk.artistArt(), { active: true }),
queryClient.cancelQueries(qk.coverArt(), { active: true }),
queryClient.cancelQueries(qk.existingFiles(), { active: true }),
queryClient.invalidateQueries(qk.artistArt(), { refetchActive: false }),
queryClient.invalidateQueries(qk.coverArt(), { refetchActive: false }),
queryClient.invalidateQueries(qk.existingFiles(), { refetchActive: false }),
])
// delete all images
const itemTypes: CacheItemTypeKey[] = ['artistArt', 'artistArtThumb', 'coverArt', 'coverArtThumb']
await Promise.all(
serverIds.flatMap(id =>
itemTypes.map(async type => {
const dir = cacheDir(id, type)
try {
await RNFS.unlink(dir)
} catch {}
}),
),
)
// change cacheBuster
changeCacheBuster()
} finally {
setDisableMusicTabs(false)
// enable queries
await Promise.all([
queryClient.refetchQueries(qk.existingFiles(), { active: true }),
queryClient.refetchQueries(qk.artistArt(), { active: true }),
queryClient.refetchQueries(qk.coverArt(), { active: true }),
])
}
}
}
+1 -55
View File
@@ -1,12 +1,6 @@
import { Song } from '@app/models/library'
import { QueueContextType, TrackExt } from '@app/models/trackplayer'
import queryClient from '@app/queryClient'
import queueService from '@app/queueservice'
import { useStore, useStoreDeep } from '@app/state/store' import { useStore, useStoreDeep } from '@app/state/store'
import { getQueue, SetQueueOptions, trackPlayerCommands } from '@app/state/trackplayer' import { getQueue, trackPlayerCommands } from '@app/state/trackplayer'
import userAgent from '@app/util/userAgent'
import TrackPlayer from 'react-native-track-player' import TrackPlayer from 'react-native-track-player'
import qk from './queryKeys'
export const usePlay = () => { export const usePlay = () => {
return () => trackPlayerCommands.enqueue(() => TrackPlayer.play()) return () => trackPlayerCommands.enqueue(() => TrackPlayer.play())
@@ -89,51 +83,3 @@ export const useIsPlaying = (contextId: string | undefined, track: number) => {
return contextId === queueContextId && track === currentTrackIdx return contextId === queueContextId && track === currentTrackIdx
} }
export function mapSongToTrackExt(song: Song): TrackExt {
return {
id: song.id,
title: song.title,
artist: song.artist || 'Unknown Artist',
album: song.album || 'Unknown Album',
url: useStore.getState().buildStreamUri(song.id),
artwork: require('@res/fallback.png'),
userAgent,
duration: song.duration,
artistId: song.artistId,
albumId: song.albumId,
track: song.track,
discNumber: song.discNumber,
}
}
export const useSetQueue = (type: QueueContextType, songs?: Song[]) => {
const _setQueue = useStore(store => store.setQueue)
const contextId = `${type}-${songs?.map(s => s.id).join('-')}`
const setQueue = async (options: SetQueueOptions) => {
if (!songs || songs.length === 0) {
return
}
const queue = songs.map(mapSongToTrackExt)
const first = queue[options.playTrack || 0]
if (!first.albumId) {
first.artwork = require('@res/fallback.png')
} else {
const albumCoverArt = queryClient.getQueryData<string>(qk.albumCoverArt(first.albumId))
const existingFile = queryClient.getQueryData<string>(qk.existingFiles('coverArtThumb', albumCoverArt))
const downloadFile = queryClient.getQueryData<string>(qk.coverArt(albumCoverArt, 'thumbnail'))
if (existingFile || downloadFile) {
first.artwork = `file://${existingFile || downloadFile}`
}
}
await _setQueue({ queue, type, contextId, ...options })
queueService.emit('set', { queue })
}
return { setQueue, contextId }
}
-64
View File
@@ -1,64 +0,0 @@
import { BackendModule, LanguageDetectorAsyncModule } from 'i18next'
import path from 'path'
import RNFS from 'react-native-fs'
import * as RNLocalize from 'react-native-localize'
import _ from 'lodash'
const I18N_ASSETS_DIR = path.join('custom', 'i18n')
const cache: {
[language: string]: {
[key: string]: any
}
} = {}
async function loadTranslation(language: string) {
const text = await RNFS.readFileAssets(path.join(I18N_ASSETS_DIR, `${language}.json`), 'utf8')
return JSON.parse(text)
}
async function readTranslation(language: string, namespace: string) {
if (!cache[language]) {
cache[language] = await loadTranslation(language)
}
return namespace === 'translation' ? cache[language] : _.get(cache[language], namespace)
}
export const backend = {
type: 'backend',
init: () => {},
read: async (language, namespace, callback) => {
try {
callback(null, await readTranslation(language, namespace))
} catch (err) {
callback(err as any, null)
}
},
} as BackendModule
export const languageDetector = {
type: 'languageDetector',
async: true,
detect: async callback => {
try {
const languageTags = (await RNFS.readDirAssets(I18N_ASSETS_DIR))
.map(f => f.name)
.filter(n => n.endsWith('.json'))
.map(n => n.slice(0, -5))
console.log('translations available:', languageTags)
console.log(
'locales list:',
RNLocalize.getLocales().map(l => l.languageTag),
)
console.log('best language:', RNLocalize.findBestAvailableLanguage(languageTags)?.languageTag)
callback(RNLocalize.findBestAvailableLanguage(languageTags)?.languageTag)
} catch {
callback(undefined)
}
},
init: () => {},
cacheUserLanguage: () => {},
} as LanguageDetectorAsyncModule
+1
View File
@@ -5,6 +5,7 @@ export enum CacheItemType {
coverArtThumb = 'coverArtThumb', coverArtThumb = 'coverArtThumb',
artistArt = 'artistArt', artistArt = 'artistArt',
artistArtThumb = 'artistArtThumb', artistArtThumb = 'artistArtThumb',
song = 'song',
} }
export type CacheItemTypeKey = keyof typeof CacheItemType export type CacheItemTypeKey = keyof typeof CacheItemType
+7 -14
View File
@@ -2,7 +2,7 @@ export interface Artist {
itemType: 'artist' itemType: 'artist'
id: string id: string
name: string name: string
starred?: number starred?: Date
coverArt?: string coverArt?: string
} }
@@ -18,7 +18,7 @@ export interface Album {
name: string name: string
artist?: string artist?: string
artistId?: string artistId?: string
starred?: number starred?: Date
coverArt?: string coverArt?: string
year?: number year?: number
} }
@@ -42,23 +42,16 @@ export interface Song {
track?: number track?: number
discNumber?: number discNumber?: number
duration?: number duration?: number
starred?: number starred?: Date
playCount?: number coverArt?: string
userRating?: number
averageRating?: number
} }
export interface SearchResults { export interface SearchResults {
artists: Artist[] artists: string[]
albums: Album[] albums: string[]
songs: Song[] songs: string[]
} }
export type StarrableItemType = 'album' | 'song' | 'artist' export type StarrableItemType = 'album' | 'song' | 'artist'
export type ListableItem = Album | Song | Artist | Playlist export type ListableItem = Album | Song | Artist | Playlist
export interface AlbumCoverArt {
albumId: string
coverArt?: string
}
-84
View File
@@ -1,84 +0,0 @@
import {
AlbumID3Element,
ArtistID3Element,
ArtistInfo2Element,
ChildElement,
PlaylistElement,
} from '@app/subsonic/elements'
import { Album, Artist, ArtistInfo, Playlist, Song } from './library'
import { TrackExt } from './trackplayer'
export function mapArtist(artist: ArtistID3Element): Artist {
return {
itemType: 'artist',
id: artist.id,
name: artist.name,
starred: artist.starred?.getTime(),
coverArt: artist.coverArt,
}
}
export function mapArtistInfo(id: string, info: ArtistInfo2Element): ArtistInfo {
return {
id,
smallImageUrl: info.smallImageUrl,
largeImageUrl: info.largeImageUrl,
}
}
export function mapAlbum(album: AlbumID3Element): Album {
return {
itemType: 'album',
id: album.id,
name: album.name,
artist: album.artist,
artistId: album.artistId,
starred: album.starred?.getTime(),
coverArt: album.coverArt,
year: album.year,
}
}
export function mapPlaylist(playlist: PlaylistElement): Playlist {
return {
itemType: 'playlist',
id: playlist.id,
name: playlist.name,
comment: playlist.comment,
coverArt: playlist.coverArt,
}
}
export function mapSong(song: ChildElement): Song {
return {
itemType: 'song',
id: song.id,
album: song.album,
albumId: song.albumId,
artist: song.artist,
artistId: song.artistId,
title: song.title,
track: song.track,
discNumber: song.discNumber,
duration: song.duration,
starred: song.starred?.getTime(),
playCount: song.playCount,
averageRating: song.averageRating,
userRating: song.userRating,
}
}
export function mapTrackExtToSong(track: TrackExt): Song {
return {
itemType: 'song',
id: track.id,
title: track.title as string,
artist: track.artist,
album: track.album,
duration: track.duration,
artistId: track.artistId,
albumId: track.albumId,
track: track.track,
discNumber: track.discNumber,
}
}
-5
View File
@@ -12,8 +12,3 @@ export interface OrderedById<T> {
export interface PaginatedList { export interface PaginatedList {
[offset: number]: string[] [offset: number]: string[]
} }
export interface CollectionById<T extends { id: string }> {
byId: ById<T>
allIds: string[]
}
+4 -16
View File
@@ -18,11 +18,10 @@ const BottomTabButton = React.memo<{
isFocused: boolean isFocused: boolean
icon: OutlineFillIcon icon: OutlineFillIcon
navigation: NavigationHelpers<ParamListBase, BottomTabNavigationEventMap> navigation: NavigationHelpers<ParamListBase, BottomTabNavigationEventMap>
disabled?: boolean }>(({ routeKey, label, name, isFocused, icon, navigation }) => {
}>(({ routeKey, label, name, isFocused, icon, navigation, disabled }) => {
const firstRun = useFirstRun() const firstRun = useFirstRun()
disabled = !!disabled || (firstRun && name !== 'settings') const disabled = firstRun && name !== 'settings'
const onPress = () => { const onPress = () => {
const event = navigation.emit({ const event = navigation.emit({
@@ -48,9 +47,7 @@ const BottomTabButton = React.memo<{
return ( return (
<PressableOpacity onPress={onPress} style={styles.button} disabled={disabled}> <PressableOpacity onPress={onPress} style={styles.button} disabled={disabled}>
<Image source={imgSource} style={imgStyle} fadeDuration={0} /> <Image source={imgSource} style={imgStyle} fadeDuration={0} />
<Text style={textStyle} numberOfLines={1} ellipsizeMode="clip"> <Text style={textStyle}>{label}</Text>
{label}
</Text>
</PressableOpacity> </PressableOpacity>
) )
}) })
@@ -68,13 +65,6 @@ const BottomTabBar: React.FC<BottomTabBarProps> = ({ state, descriptors, navigat
? options.title ? options.title
: route.name : route.name
let iconKey = route.name
let disabled = false
if (route.name.endsWith('-disabled')) {
iconKey = route.name.split('-')[0]
disabled = true
}
return ( return (
<BottomTabButton <BottomTabButton
key={route.key} key={route.key}
@@ -82,9 +72,8 @@ const BottomTabBar: React.FC<BottomTabBarProps> = ({ state, descriptors, navigat
label={label} label={label}
name={route.name} name={route.name}
isFocused={state.index === index} isFocused={state.index === index}
icon={bottomTabIcons[iconKey]} icon={bottomTabIcons[route.name]}
navigation={navigation} navigation={navigation}
disabled={disabled}
/> />
) )
})} })}
@@ -103,7 +92,6 @@ const styles = StyleSheet.create({
}, },
button: { button: {
alignItems: 'center', alignItems: 'center',
flexGrow: 1,
flex: 1, flex: 1,
height: '100%', height: '100%',
}, },
+26 -44
View File
@@ -1,6 +1,4 @@
import { withSuspense } from '@app/components/withSuspense'
import { useFirstRun } from '@app/hooks/settings' import { useFirstRun } from '@app/hooks/settings'
import { Album, Playlist } from '@app/models/library'
import BottomTabBar from '@app/navigation/BottomTabBar' import BottomTabBar from '@app/navigation/BottomTabBar'
import LibraryTopTabNavigator from '@app/navigation/LibraryTopTabNavigator' import LibraryTopTabNavigator from '@app/navigation/LibraryTopTabNavigator'
import ArtistView from '@app/screens/ArtistView' import ArtistView from '@app/screens/ArtistView'
@@ -11,21 +9,19 @@ import ServerView from '@app/screens/ServerView'
import SettingsView from '@app/screens/Settings' import SettingsView from '@app/screens/Settings'
import SongListView from '@app/screens/SongListView' import SongListView from '@app/screens/SongListView'
import WebViewScreen from '@app/screens/WebViewScreen' import WebViewScreen from '@app/screens/WebViewScreen'
import { useStore } from '@app/state/store'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import font from '@app/styles/font' import font from '@app/styles/font'
import { BottomTabNavigationProp, createBottomTabNavigator } from '@react-navigation/bottom-tabs' import { BottomTabNavigationProp, createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import { RouteProp, StackActions } from '@react-navigation/native' import { RouteProp, StackActions } from '@react-navigation/native'
import React, { useEffect } from 'react' import React, { useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet } from 'react-native' import { StyleSheet } from 'react-native'
import { createNativeStackNavigator, NativeStackNavigationProp } from 'react-native-screens/native-stack' import { createNativeStackNavigator, NativeStackNavigationProp } from 'react-native-screens/native-stack'
type TabStackParamList = { type TabStackParamList = {
main: undefined main: undefined
album: { id: string; title: string; album?: Album } album: { id: string; title: string }
artist: { id: string; title: string } artist: { id: string; title: string }
playlist: { id: string; title: string; playlist?: Playlist } playlist: { id: string; title: string }
results: { query: string; type: 'album' | 'song' | 'artist' } results: { query: string; type: 'album' | 'song' | 'artist' }
} }
@@ -36,7 +32,9 @@ type AlbumScreenProps = {
navigation: AlbumScreenNavigationProp navigation: AlbumScreenNavigationProp
} }
const AlbumScreen: React.FC<AlbumScreenProps> = ({ route }) => <SongListView {...route.params} type="album" /> const AlbumScreen: React.FC<AlbumScreenProps> = ({ route }) => (
<SongListView id={route.params.id} title={route.params.title} type="album" />
)
type ArtistScreenNavigationProp = NativeStackNavigationProp<TabStackParamList, 'artist'> type ArtistScreenNavigationProp = NativeStackNavigationProp<TabStackParamList, 'artist'>
type ArtistScreenRouteProp = RouteProp<TabStackParamList, 'artist'> type ArtistScreenRouteProp = RouteProp<TabStackParamList, 'artist'>
@@ -45,7 +43,9 @@ type ArtistScreenProps = {
navigation: ArtistScreenNavigationProp navigation: ArtistScreenNavigationProp
} }
const ArtistScreen: React.FC<ArtistScreenProps> = ({ route }) => <ArtistView {...route.params} /> const ArtistScreen: React.FC<ArtistScreenProps> = ({ route }) => (
<ArtistView id={route.params.id} title={route.params.title} />
)
type PlaylistScreenNavigationProp = NativeStackNavigationProp<TabStackParamList, 'playlist'> type PlaylistScreenNavigationProp = NativeStackNavigationProp<TabStackParamList, 'playlist'>
type PlaylistScreenRouteProp = RouteProp<TabStackParamList, 'playlist'> type PlaylistScreenRouteProp = RouteProp<TabStackParamList, 'playlist'>
@@ -54,7 +54,9 @@ type PlaylistScreenProps = {
navigation: PlaylistScreenNavigationProp navigation: PlaylistScreenNavigationProp
} }
const PlaylistScreen: React.FC<PlaylistScreenProps> = ({ route }) => <SongListView {...route.params} type="playlist" /> const PlaylistScreen: React.FC<PlaylistScreenProps> = ({ route }) => (
<SongListView id={route.params.id} title={route.params.title} type="playlist" />
)
type ResultsScreenNavigationProp = NativeStackNavigationProp<TabStackParamList, 'results'> type ResultsScreenNavigationProp = NativeStackNavigationProp<TabStackParamList, 'results'>
type ResultsScreenRouteProp = RouteProp<TabStackParamList, 'results'> type ResultsScreenRouteProp = RouteProp<TabStackParamList, 'results'>
@@ -63,7 +65,9 @@ type ResultsScreenProps = {
navigation: ResultsScreenNavigationProp navigation: ResultsScreenNavigationProp
} }
const ResultsScreen: React.FC<ResultsScreenProps> = ({ route }) => <SearchResultsView {...route.params} /> const ResultsScreen: React.FC<ResultsScreenProps> = ({ route }) => (
<SearchResultsView query={route.params.query} type={route.params.type} />
)
const styles = StyleSheet.create({ const styles = StyleSheet.create({
stackheaderStyle: { stackheaderStyle: {
@@ -117,8 +121,8 @@ const SearchTab = createTabStackNavigator(Search)
type SettingsStackParamList = { type SettingsStackParamList = {
main: undefined main: undefined
server?: { id?: string; title?: string } server?: { id?: string }
web: { uri: string; title?: string } web: { uri: string }
} }
type ServerScreenNavigationProp = NativeStackNavigationProp<SettingsStackParamList, 'server'> type ServerScreenNavigationProp = NativeStackNavigationProp<SettingsStackParamList, 'server'>
@@ -127,9 +131,7 @@ type ServerScreenProps = {
route: ServerScreenRouteProp route: ServerScreenRouteProp
navigation: ServerScreenNavigationProp navigation: ServerScreenNavigationProp
} }
const ServerScreen: React.FC<ServerScreenProps> = ({ route }) => ( const ServerScreen: React.FC<ServerScreenProps> = ({ route }) => <ServerView id={route.params?.id} />
<ServerView id={route.params?.id} title={route.params?.title} />
)
type WebScreenNavigationProp = NativeStackNavigationProp<SettingsStackParamList, 'web'> type WebScreenNavigationProp = NativeStackNavigationProp<SettingsStackParamList, 'web'>
type WebScreenRouteProp = RouteProp<SettingsStackParamList, 'web'> type WebScreenRouteProp = RouteProp<SettingsStackParamList, 'web'>
@@ -137,9 +139,7 @@ type WebScreenProps = {
route: WebScreenRouteProp route: WebScreenRouteProp
navigation: WebScreenNavigationProp navigation: WebScreenNavigationProp
} }
const WebScreen: React.FC<WebScreenProps> = ({ route }) => ( const WebScreen: React.FC<WebScreenProps> = ({ route }) => <WebViewScreen uri={route.params.uri} />
<WebViewScreen uri={route.params.uri} title={route.params.title} />
)
const SettingsStack = createNativeStackNavigator() const SettingsStack = createNativeStackNavigator()
@@ -151,6 +151,7 @@ const SettingsTab = () => {
name="server" name="server"
component={ServerScreen} component={ServerScreen}
options={{ options={{
title: 'Edit Server',
headerStyle: styles.stackheaderStyle, headerStyle: styles.stackheaderStyle,
headerHideShadow: true, headerHideShadow: true,
headerTintColor: 'white', headerTintColor: 'white',
@@ -161,6 +162,7 @@ const SettingsTab = () => {
name="web" name="web"
component={WebScreen} component={WebScreen}
options={{ options={{
title: 'Web View',
headerStyle: styles.stackheaderStyle, headerStyle: styles.stackheaderStyle,
headerHideShadow: true, headerHideShadow: true,
headerTintColor: 'white', headerTintColor: 'white',
@@ -173,37 +175,17 @@ const SettingsTab = () => {
const Tab = createBottomTabNavigator() const Tab = createBottomTabNavigator()
const BottomTabNavigator = withSuspense(() => { const BottomTabNavigator = () => {
const { t } = useTranslation()
const firstRun = useFirstRun() const firstRun = useFirstRun()
const disableMusicTabs = useStore(store => store.disableMusicTabs)
return ( return (
<Tab.Navigator tabBar={BottomTabBar} initialRouteName={firstRun ? 'settings' : 'home'}> <Tab.Navigator tabBar={BottomTabBar} initialRouteName={firstRun ? 'settings' : 'home'}>
{disableMusicTabs ? ( <Tab.Screen name="home" component={HomeTab} options={{ tabBarLabel: 'Home' }} />
<> <Tab.Screen name="library" component={LibraryTab} options={{ tabBarLabel: 'Library' }} />
<Tab.Screen name="home-disabled" children={() => null} options={{ tabBarLabel: t('navigation.tabs.home') }} /> <Tab.Screen name="search" component={SearchTab} options={{ tabBarLabel: 'Search' }} />
<Tab.Screen <Tab.Screen name="settings" component={SettingsTab} options={{ tabBarLabel: 'Settings' }} />
name="library-disabled"
children={() => null}
options={{ tabBarLabel: t('navigation.tabs.library') }}
/>
<Tab.Screen
name="search-disabled"
children={() => null}
options={{ tabBarLabel: t('navigation.tabs.search') }}
/>
</>
) : (
<>
<Tab.Screen name="home" component={HomeTab} options={{ tabBarLabel: t('navigation.tabs.home') }} />
<Tab.Screen name="library" component={LibraryTab} options={{ tabBarLabel: t('navigation.tabs.library') }} />
<Tab.Screen name="search" component={SearchTab} options={{ tabBarLabel: t('navigation.tabs.search') }} />
</>
)}
<Tab.Screen name="settings" component={SettingsTab} options={{ tabBarLabel: t('navigation.tabs.settings') }} />
</Tab.Navigator> </Tab.Navigator>
) )
}) }
export default BottomTabNavigator export default BottomTabNavigator
+7 -26
View File
@@ -1,4 +1,3 @@
import { withSuspense } from '@app/components/withSuspense'
import AlbumsTab from '@app/screens/LibraryAlbums' import AlbumsTab from '@app/screens/LibraryAlbums'
import ArtistsTab from '@app/screens/LibraryArtists' import ArtistsTab from '@app/screens/LibraryArtists'
import PlaylistsTab from '@app/screens/LibraryPlaylists' import PlaylistsTab from '@app/screens/LibraryPlaylists'
@@ -7,46 +6,28 @@ import dimensions from '@app/styles/dimensions'
import font from '@app/styles/font' import font from '@app/styles/font'
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs' import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs'
import React from 'react' import React from 'react'
import { useTranslation } from 'react-i18next' import { StatusBar, StyleSheet } from 'react-native'
import { StyleSheet } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
const Tab = createMaterialTopTabNavigator() const Tab = createMaterialTopTabNavigator()
const LibraryTopTabNavigator = withSuspense(() => { const LibraryTopTabNavigator = () => (
const { t } = useTranslation()
const marginTop = useSafeAreaInsets().top
return (
<Tab.Navigator <Tab.Navigator
tabBarOptions={{ tabBarOptions={{
style: [styles.tabBar, { marginTop }], style: styles.tabBar,
labelStyle: styles.tablabelStyle, labelStyle: styles.tablabelStyle,
indicatorStyle: styles.tabindicatorStyle, indicatorStyle: styles.tabindicatorStyle,
}} }}
initialRouteName="albums"> initialRouteName="albums">
<Tab.Screen <Tab.Screen name="albums" component={AlbumsTab} options={{ tabBarLabel: 'Albums' }} />
name="albums" <Tab.Screen name="artists" component={ArtistsTab} options={{ tabBarLabel: 'Artists' }} />
component={AlbumsTab} <Tab.Screen name="playlists" component={PlaylistsTab} options={{ tabBarLabel: 'Playlists' }} />
options={{ tabBarLabel: t('resources.album.name', { count: 2 }) }}
/>
<Tab.Screen
name="artists"
component={ArtistsTab}
options={{ tabBarLabel: t('resources.artist.name', { count: 2 }) }}
/>
<Tab.Screen
name="playlists"
component={PlaylistsTab}
options={{ tabBarLabel: t('resources.playlist.name', { count: 2 }) }}
/>
</Tab.Navigator> </Tab.Navigator>
) )
})
const styles = StyleSheet.create({ const styles = StyleSheet.create({
tabBar: { tabBar: {
height: dimensions.header, height: dimensions.header,
marginTop: StatusBar.currentHeight,
backgroundColor: colors.gradient.high, backgroundColor: colors.gradient.high,
elevation: 0, elevation: 0,
justifyContent: 'center', justifyContent: 'center',
+2 -8
View File
@@ -1,4 +1,3 @@
import { withSuspense } from '@app/components/withSuspense'
import BottomTabNavigator from '@app/navigation/BottomTabNavigator' import BottomTabNavigator from '@app/navigation/BottomTabNavigator'
import NowPlayingQueue from '@app/screens/NowPlayingQueue' import NowPlayingQueue from '@app/screens/NowPlayingQueue'
import NowPlayingView from '@app/screens/NowPlayingView' import NowPlayingView from '@app/screens/NowPlayingView'
@@ -6,22 +5,18 @@ import colors from '@app/styles/colors'
import font from '@app/styles/font' import font from '@app/styles/font'
import { DarkTheme, NavigationContainer } from '@react-navigation/native' import { DarkTheme, NavigationContainer } from '@react-navigation/native'
import React from 'react' import React from 'react'
import { useTranslation } from 'react-i18next'
import { createNativeStackNavigator } from 'react-native-screens/native-stack' import { createNativeStackNavigator } from 'react-native-screens/native-stack'
const NowPlayingStack = createNativeStackNavigator() const NowPlayingStack = createNativeStackNavigator()
const NowPlayingNavigator = withSuspense(() => { const NowPlayingNavigator = () => (
const { t } = useTranslation()
return (
<NowPlayingStack.Navigator> <NowPlayingStack.Navigator>
<NowPlayingStack.Screen name="main" component={NowPlayingView} options={{ headerShown: false }} /> <NowPlayingStack.Screen name="main" component={NowPlayingView} options={{ headerShown: false }} />
<NowPlayingStack.Screen <NowPlayingStack.Screen
name="queue" name="queue"
component={NowPlayingQueue} component={NowPlayingQueue}
options={{ options={{
title: t('resources.queue.name', { count: 1 }), title: 'Queue',
headerStyle: { headerStyle: {
backgroundColor: colors.gradient.high, backgroundColor: colors.gradient.high,
}, },
@@ -36,7 +31,6 @@ const NowPlayingNavigator = withSuspense(() => {
/> />
</NowPlayingStack.Navigator> </NowPlayingStack.Navigator>
) )
})
const RootStack = createNativeStackNavigator() const RootStack = createNativeStackNavigator()
+5 -152
View File
@@ -1,14 +1,8 @@
import { getCurrentTrack, getPlayerState, trackPlayerCommands } from '@app/state/trackplayer' import { getCurrentTrack, getPlayerState, trackPlayerCommands } from '@app/state/trackplayer'
import NetInfo, { NetInfoStateType } from '@react-native-community/netinfo'
import _ from 'lodash'
import { unstable_batchedUpdates } from 'react-native'
import TrackPlayer, { Event, State } from 'react-native-track-player' import TrackPlayer, { Event, State } from 'react-native-track-player'
import { fetchAlbum, FetchExisingFileOptions, fetchExistingFile, fetchFile, FetchFileOptions } from './hooks/fetch'
import qk from './hooks/queryKeys'
import queryClient from './queryClient'
import queueService from './queueservice'
import { useStore } from './state/store' import { useStore } from './state/store'
import { ReturnedPromiseResolvedType } from './util/types' import { unstable_batchedUpdates } from 'react-native'
import NetInfo, { NetInfoStateType } from '@react-native-community/netinfo'
const reset = () => { const reset = () => {
unstable_batchedUpdates(() => { unstable_batchedUpdates(() => {
@@ -34,15 +28,9 @@ const setNetState = (netState: 'mobile' | 'wifi') => {
}) })
} }
const rebuildQueue = (forcePlay?: boolean) => { const rebuildQueue = () => {
unstable_batchedUpdates(() => { unstable_batchedUpdates(() => {
useStore.getState().rebuildQueue(forcePlay) useStore.getState().rebuildQueue(useStore.getState().playerState === State.Playing)
})
}
const updateQueue = () => {
unstable_batchedUpdates(() => {
useStore.getState().updateQueue()
}) })
} }
@@ -52,69 +40,6 @@ const setDuckPaused = (duckPaused: boolean) => {
}) })
} }
const setQueryDataAlbum = (queryKey: any, data: ReturnedPromiseResolvedType<typeof fetchAlbum>) => {
unstable_batchedUpdates(() => {
queryClient.setQueryData(queryKey, data)
})
}
const setQueryDataExistingFiles = (queryKey: any, data: ReturnedPromiseResolvedType<typeof fetchExistingFile>) => {
unstable_batchedUpdates(() => {
queryClient.setQueryData(queryKey, data)
})
}
const setQueryDataCoverArt = (queryKey: any, data: ReturnedPromiseResolvedType<typeof fetchFile>) => {
unstable_batchedUpdates(() => {
queryClient.setQueryData(queryKey, data)
})
}
function getClient() {
const client = useStore.getState().client
if (!client) {
throw new Error('no client!')
}
return client
}
async function getAlbum(id: string) {
try {
const res = await fetchAlbum(id, getClient())
setQueryDataAlbum(qk.album(id), res)
return res
} catch {}
}
async function getCoverArtThumbExisting(coverArt: string) {
const serverId = useStore.getState().settings.activeServerId
const options: FetchExisingFileOptions = { itemType: 'coverArtThumb', itemId: coverArt }
try {
const res = await fetchExistingFile(options, serverId)
setQueryDataExistingFiles(qk.existingFiles(options.itemType, options.itemId), res)
return res
} catch {}
}
async function getCoverArtThumb(coverArt: string) {
const serverId = useStore.getState().settings.activeServerId
const fromUrl = getClient().getCoverArtUri({ id: coverArt, size: '256' })
const options: FetchFileOptions = {
itemType: 'coverArtThumb',
itemId: coverArt,
fromUrl,
expectedContentType: 'image',
}
try {
const res = await fetchFile(options, serverId)
setQueryDataCoverArt(qk.coverArt(coverArt, 'thumbnail'), res)
return res
} catch {}
}
let serviceCreated = false let serviceCreated = false
const createService = async () => { const createService = async () => {
@@ -214,81 +139,9 @@ const createService = async () => {
// fix for ExoPlayer aborting playback while esimating content length // fix for ExoPlayer aborting playback while esimating content length
if (code === 'playback-source' && message.includes('416')) { if (code === 'playback-source' && message.includes('416')) {
rebuildQueue(true) rebuildQueue()
} }
}) })
queueService.addListener('set', async ({ queue }) => {
const contextId = useStore.getState().queueContextId
const throwIfQueueChanged = () => {
if (contextId !== useStore.getState().queueContextId) {
throw 'queue-changed'
}
}
const albumIds = _.uniq(queue.map(s => s.albumId)).filter((id): id is string => id !== undefined)
const albumIdImagePath: { [albumId: string]: string | undefined } = {}
for (const albumId of albumIds) {
let coverArt = queryClient.getQueryData<string>(qk.albumCoverArt(albumId))
if (!coverArt) {
throwIfQueueChanged()
console.log('no cached coverArt for album', albumId, 'getting album...')
coverArt = (await getAlbum(albumId))?.album.coverArt
if (!coverArt) {
continue
}
}
let imagePath =
queryClient.getQueryData<string>(qk.existingFiles('coverArtThumb', coverArt)) ||
queryClient.getQueryData<string>(qk.coverArt(coverArt, 'thumbnail'))
if (!imagePath) {
throwIfQueueChanged()
console.log('no cached image for', coverArt, 'getting file...')
imagePath = (await getCoverArtThumbExisting(coverArt)) || (await getCoverArtThumb(coverArt))
if (!imagePath) {
continue
}
}
albumIdImagePath[albumId] = imagePath
}
for (let i = 0; i < queue.length; i++) {
const track = queue[i]
if (typeof track.artwork === 'string') {
continue
}
if (!track.albumId) {
continue
}
let imagePath = albumIdImagePath[track.albumId]
if (!imagePath) {
continue
}
try {
throwIfQueueChanged()
let trackIdx = i
const shuffleOrder = useStore.getState().shuffleOrder
if (shuffleOrder) {
trackIdx = shuffleOrder.indexOf(i)
}
await TrackPlayer.updateMetadataForTrack(trackIdx, { ...track, artwork: `file://${imagePath}` })
} catch {
break
}
}
await trackPlayerCommands.enqueue(async () => {
updateQueue()
})
})
} }
module.exports = async function () { module.exports = async function () {
-5
View File
@@ -1,5 +0,0 @@
import { QueryClient } from 'react-query'
const client = new QueryClient()
export default client
-18
View File
@@ -1,18 +0,0 @@
/* eslint-disable no-dupe-class-members */
import { EmitterSubscription, NativeEventEmitter } from 'react-native'
import { TrackExt } from './models/trackplayer'
class QueueService extends NativeEventEmitter {
addListener(eventType: 'set', listener: (event: { queue: TrackExt[] }) => void): EmitterSubscription
addListener(eventType: string, listener: (event: any) => void, context?: Object): EmitterSubscription {
return super.addListener(eventType, listener, context)
}
emit(eventType: 'set', event: { queue: TrackExt[] }): void
emit(eventType: string, ...params: any[]): void {
super.emit(eventType, ...params)
}
}
const queueService = new QueueService()
export default queueService
+47 -39
View File
@@ -5,18 +5,15 @@ import GradientScrollView from '@app/components/GradientScrollView'
import Header from '@app/components/Header' import Header from '@app/components/Header'
import HeaderBar from '@app/components/HeaderBar' import HeaderBar from '@app/components/HeaderBar'
import ListItem from '@app/components/ListItem' import ListItem from '@app/components/ListItem'
import { withSuspenseMemo } from '@app/components/withSuspense'
import { useQueryArtist, useQueryArtistTopSongs } from '@app/hooks/query'
import { useSetQueue } from '@app/hooks/trackplayer'
import { Album, Song } from '@app/models/library' import { Album, Song } from '@app/models/library'
import { useStore, useStoreDeep } from '@app/state/store'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import dimensions from '@app/styles/dimensions' import dimensions from '@app/styles/dimensions'
import font from '@app/styles/font' import font from '@app/styles/font'
import { mapById } from '@app/util/state'
import { useLayout } from '@react-native-community/hooks' import { useLayout } from '@react-native-community/hooks'
import { useNavigation } from '@react-navigation/native' import { useNavigation } from '@react-navigation/native'
import equal from 'fast-deep-equal/es6/react' import React, { useCallback, useEffect } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native' import { ActivityIndicator, StyleSheet, Text, View } from 'react-native'
import { useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from 'react-native-reanimated' import { useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from 'react-native-reanimated'
@@ -34,51 +31,45 @@ const AlbumItem = React.memo<{
return ( return (
<AlbumContextPressable <AlbumContextPressable
album={album} album={album}
onPress={() => navigation.navigate('album', { id: album.id, title: album.name, album })} onPress={() => navigation.navigate('album', { id: album.id, title: album.name })}
menuStyle={[styles.albumItem, { width }]} menuStyle={[styles.albumItem, { width }]}
triggerOuterWrapperStyle={{ width }}> triggerOuterWrapperStyle={{ width }}>
<CoverArt type="cover" coverArt={album.coverArt} style={{ height, width }} resizeMode="cover" size="thumbnail" /> <CoverArt type="cover" coverArt={album.coverArt} style={{ height, width }} resizeMode={'cover'} />
<Text style={styles.albumTitle}>{album.name}</Text> <Text style={styles.albumTitle}>{album.name}</Text>
<Text style={styles.albumYear}> {album.year ? album.year : ''}</Text> <Text style={styles.albumYear}> {album.year ? album.year : ''}</Text>
</AlbumContextPressable> </AlbumContextPressable>
) )
}, equal) })
const TopSongs = withSuspenseMemo<{ const TopSongs = React.memo<{
songs: Song[] songs: Song[]
name: string name: string
}>( artistId: string
({ songs, name }) => { }>(({ songs, name, artistId }) => {
const { setQueue, contextId } = useSetQueue('artist', songs) const setQueue = useStore(store => store.setQueue)
const { t } = useTranslation()
return ( return (
<> <>
<Header>{t('resources.song.lists.artistTopSongs')}</Header> <Header>Top Songs</Header>
{songs.slice(0, 5).map((s, i) => ( {songs.slice(0, 5).map((s, i) => (
<ListItem <ListItem
key={i} key={i}
item={s} item={s}
contextId={contextId} contextId={artistId}
queueId={i} queueId={i}
showArt={true} showArt={true}
subtitle={s.album} subtitle={s.album}
onPress={() => setQueue({ title: name, playTrack: i })} onPress={() => setQueue(songs, name, 'artist', artistId, i)}
/> />
))} ))}
</> </>
) )
}, })
null,
equal,
)
const ArtistAlbums = withSuspenseMemo<{ const ArtistAlbums = React.memo<{
albums: Album[] albums: Album[]
}>( }>(({ albums }) => {
({ albums }) => {
const albumsLayout = useLayout() const albumsLayout = useLayout()
const { t } = useTranslation()
const sortedAlbums = [...albums] const sortedAlbums = [...albums]
.sort((a, b) => a.name.localeCompare(b.name)) .sort((a, b) => a.name.localeCompare(b.name))
@@ -88,7 +79,7 @@ const ArtistAlbums = withSuspenseMemo<{
return ( return (
<> <>
<Header>{t('resources.album.name', { count: 2 })}</Header> <Header>Albums</Header>
<View style={styles.albums} onLayout={albumsLayout.onLayout}> <View style={styles.albums} onLayout={albumsLayout.onLayout}>
{sortedAlbums.map(a => ( {sortedAlbums.map(a => (
<AlbumItem key={a.id} album={a} height={albumSize} width={albumSize} /> <AlbumItem key={a.id} album={a} height={albumSize} width={albumSize} />
@@ -96,10 +87,7 @@ const ArtistAlbums = withSuspenseMemo<{
</View> </View>
</> </>
) )
}, })
null,
equal,
)
const ArtistViewFallback = React.memo(() => ( const ArtistViewFallback = React.memo(() => (
<GradientBackground style={styles.fallback}> <GradientBackground style={styles.fallback}>
@@ -108,8 +96,18 @@ const ArtistViewFallback = React.memo(() => (
)) ))
const ArtistView = React.memo<{ id: string; title: string }>(({ id, title }) => { const ArtistView = React.memo<{ id: string; title: string }>(({ id, title }) => {
const { data: artistData } = useQueryArtist(id) const artist = useStoreDeep(useCallback(store => store.library.artists[id], [id]))
const { data: topSongs, isError } = useQueryArtistTopSongs(artistData?.artist?.name) const topSongIds = useStoreDeep(useCallback(store => store.library.artistNameTopSongs[artist?.name], [artist?.name]))
const topSongs = useStoreDeep(
useCallback(store => (topSongIds ? mapById(store.library.songs, topSongIds) : undefined), [topSongIds]),
)
const albumIds = useStoreDeep(useCallback(store => store.library.artistAlbums[id], [id]))
const albums = useStoreDeep(
useCallback(store => (albumIds ? mapById(store.library.albums, albumIds) : undefined), [albumIds]),
)
const fetchArtist = useStore(store => store.fetchArtist)
const fetchTopSongs = useStore(store => store.fetchArtistTopSongs)
const coverLayout = useLayout() const coverLayout = useLayout()
const headerOpacity = useSharedValue(0) const headerOpacity = useSharedValue(0)
@@ -126,12 +124,22 @@ const ArtistView = React.memo<{ id: string; title: string }>(({ id, title }) =>
} }
}) })
if (!artistData) { useEffect(() => {
if (!artist || !albumIds) {
fetchArtist(id)
}
}, [artist, albumIds, fetchArtist, id])
useEffect(() => {
if (artist && !topSongIds) {
fetchTopSongs(artist.name)
}
}, [artist, fetchTopSongs, topSongIds])
if (!artist) {
return <ArtistViewFallback /> return <ArtistViewFallback />
} }
const { artist, albums } = artistData
return ( return (
<View style={styles.container}> <View style={styles.container}>
<HeaderBar title={title} headerStyle={[styles.header, animatedOpacity]} /> <HeaderBar title={title} headerStyle={[styles.header, animatedOpacity]} />
@@ -141,15 +149,15 @@ const ArtistView = React.memo<{ id: string; title: string }>(({ id, title }) =>
style={styles.scroll} style={styles.scroll}
contentContainerStyle={styles.scrollContent} contentContainerStyle={styles.scrollContent}
onScroll={onScroll}> onScroll={onScroll}>
<CoverArt type="artist" size="original" artistId={artist.id} style={styles.artistCover} resizeMode="cover" /> <CoverArt type="artist" size="original" artistId={artist.id} style={styles.artistCover} resizeMode={'cover'} />
<View style={styles.titleContainer}> <View style={styles.titleContainer}>
<Text style={styles.title}>{artist.name}</Text> <Text style={styles.title}>{artist.name}</Text>
</View> </View>
<View style={styles.contentContainer}> <View style={styles.contentContainer}>
{(topSongs || isError) && artist ? ( {topSongs && albums ? (
topSongs && topSongs.length > 0 ? ( topSongs.length > 0 ? (
<> <>
<TopSongs songs={topSongs} name={artist.name} /> <TopSongs songs={topSongs} name={artist.name} artistId={artist.id} />
<ArtistAlbums albums={albums} /> <ArtistAlbums albums={albums} />
</> </>
) : ( ) : (
+85 -37
View File
@@ -3,36 +3,45 @@ import CoverArt from '@app/components/CoverArt'
import GradientScrollView from '@app/components/GradientScrollView' import GradientScrollView from '@app/components/GradientScrollView'
import Header from '@app/components/Header' import Header from '@app/components/Header'
import NothingHere from '@app/components/NothingHere' import NothingHere from '@app/components/NothingHere'
import { withSuspenseMemo } from '@app/components/withSuspense' import { useActiveServerRefresh } from '@app/hooks/settings'
import { useQueryHomeLists } from '@app/hooks/query' import { useStore, useStoreDeep } from '@app/state/store'
import { Album } from '@app/models/library'
import { useStoreDeep } from '@app/state/store'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import font from '@app/styles/font' import font from '@app/styles/font'
import { GetAlbumList2TypeBase } from '@app/subsonic/params' import { GetAlbumList2TypeBase, GetAlbumListType } from '@app/subsonic/params'
import { useNavigation } from '@react-navigation/native' import { useNavigation } from '@react-navigation/native'
import equal from 'fast-deep-equal/es6/react' import equal from 'fast-deep-equal/es6/react'
import React from 'react' import produce from 'immer'
import { useTranslation } from 'react-i18next' import React, { useCallback, useState } from 'react'
import { RefreshControl, ScrollView, StyleSheet, Text, View } from 'react-native' import { RefreshControl, ScrollView, StatusBar, StyleSheet, Text, View } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context' import create, { StateSelector } from 'zustand'
const titles: { [key in GetAlbumListType]?: string } = {
recent: 'Recently Played',
random: 'Random Albums',
frequent: 'Frequently Played',
starred: 'Starred Albums',
}
const AlbumItem = React.memo<{ const AlbumItem = React.memo<{
album: Album id: string
}>(({ album }) => { }>(({ id }) => {
const navigation = useNavigation() const navigation = useNavigation()
const album = useStoreDeep(useCallback(store => store.library.albums[id], [id]))
if (!album) {
return <></>
}
return ( return (
<AlbumContextPressable <AlbumContextPressable
album={album} album={album}
triggerWrapperStyle={styles.item} triggerWrapperStyle={styles.item}
onPress={() => navigation.navigate('album', { id: album.id, title: album.name, album })}> onPress={() => navigation.navigate('album', { id: album.id, title: album.name })}>
<CoverArt <CoverArt
type="cover" type="cover"
coverArt={album.coverArt} coverArt={album.coverArt}
style={{ height: styles.item.width, width: styles.item.width }} style={{ height: styles.item.width, width: styles.item.width }}
resizeMode="cover" resizeMode={'cover'}
size="thumbnail"
/> />
<Text style={styles.title} numberOfLines={1}> <Text style={styles.title} numberOfLines={1}>
{album.name} {album.name}
@@ -42,18 +51,13 @@ const AlbumItem = React.memo<{
</Text> </Text>
</AlbumContextPressable> </AlbumContextPressable>
) )
}, equal)
const CategoryHeader = withSuspenseMemo<{ type: string }>(({ type }) => {
const { t } = useTranslation()
console.log('type', type, t(`resources.album.lists.${type}`))
return <Header style={styles.header}>{t(`resources.album.lists.${type}`)}</Header>
}) })
const Category = React.memo<{ const Category = React.memo<{
type: string type: string
albums: Album[] }>(({ type }) => {
}>(({ type, albums }) => { const list = useHomeStoreDeep(useCallback(store => store.lists[type] || [], [type]))
const Albums = () => ( const Albums = () => (
<ScrollView <ScrollView
horizontal={true} horizontal={true}
@@ -61,8 +65,8 @@ const Category = React.memo<{
overScrollMode={'never'} overScrollMode={'never'}
style={styles.artScroll} style={styles.artScroll}
contentContainerStyle={styles.artScrollContent}> contentContainerStyle={styles.artScrollContent}>
{albums.map(a => ( {list.map(id => (
<AlbumItem key={a.id} album={a} /> <AlbumItem key={id} id={id} />
))} ))}
</ScrollView> </ScrollView>
) )
@@ -75,34 +79,75 @@ const Category = React.memo<{
return ( return (
<View style={styles.category}> <View style={styles.category}>
<CategoryHeader type={type} /> <Header style={styles.header}>{titles[type as GetAlbumListType] || ''}</Header>
{albums.length > 0 ? <Albums /> : <Nothing />} {list.length > 0 ? <Albums /> : <Nothing />}
</View> </View>
) )
}, equal) })
interface HomeState {
lists: { [type: string]: string[] }
setList: (type: string, list: string[]) => void
}
const useHomeStore = create<HomeState>(set => ({
lists: {},
setList: (type, list) => {
set(
produce<HomeState>(state => {
state.lists[type] = list
}),
)
},
}))
function useHomeStoreDeep<U>(stateSelector: StateSelector<HomeState, U>) {
return useHomeStore(stateSelector, equal)
}
const Home = () => { const Home = () => {
const [refreshing, setRefreshing] = useState(false)
const types = useStoreDeep(store => store.settings.screens.home.listTypes) const types = useStoreDeep(store => store.settings.screens.home.listTypes)
const listQueries = useQueryHomeLists(types as GetAlbumList2TypeBase[], 20) const fetchAlbumList = useStore(store => store.fetchAlbumList)
const paddingTop = useSafeAreaInsets().top const setList = useHomeStore(store => store.setList)
const refresh = useCallback(async () => {
setRefreshing(true)
await Promise.all(
types.map(async type => {
const ids = await fetchAlbumList({ type: type as GetAlbumList2TypeBase, size: 20, offset: 0 })
setList(type, ids)
}),
)
setRefreshing(false)
}, [fetchAlbumList, setList, types])
useActiveServerRefresh(
useCallback(() => {
types.forEach(type => setList(type, []))
refresh()
}, [refresh, setList, types]),
)
return ( return (
<GradientScrollView <GradientScrollView
style={styles.scroll} style={styles.scroll}
contentContainerStyle={{ paddingTop }} contentContainerStyle={styles.scrollContentContainer}
refreshControl={ refreshControl={
<RefreshControl <RefreshControl
refreshing={listQueries.some(q => q.isLoading)} refreshing={refreshing}
onRefresh={() => listQueries.forEach(q => q.refetch())} onRefresh={refresh}
colors={[colors.accent, colors.accentLow]} colors={[colors.accent, colors.accentLow]}
progressViewOffset={paddingTop} progressViewOffset={StatusBar.currentHeight}
/> />
}> }>
<View style={styles.content}> <View style={styles.content}>
{types.map(type => { {types.map(type => (
const query = listQueries.find(list => list.data?.type === type) <Category key={type} type={type} />
return <Category key={type} type={type} albums={query?.data?.albums || []} /> ))}
})}
</View> </View>
</GradientScrollView> </GradientScrollView>
) )
@@ -112,6 +157,9 @@ const styles = StyleSheet.create({
scroll: { scroll: {
flex: 1, flex: 1,
}, },
scrollContentContainer: {
paddingTop: StatusBar.currentHeight,
},
content: { content: {
paddingBottom: 20, paddingBottom: 20,
}, },
+79 -57
View File
@@ -1,25 +1,22 @@
import { AlbumContextPressable } from '@app/components/ContextMenu' import { AlbumContextPressable } from '@app/components/ContextMenu'
import CoverArt from '@app/components/CoverArt' import CoverArt from '@app/components/CoverArt'
import FilterButton from '@app/components/FilterButton' import FilterButton, { OptionData } from '@app/components/FilterButton'
import GradientFlatList from '@app/components/GradientFlatList' import GradientFlatList from '@app/components/GradientFlatList'
import { withSuspenseMemo } from '@app/components/withSuspense' import { useFetchPaginatedList } from '@app/hooks/list'
import { useQueryAlbumList } from '@app/hooks/query'
import { Album } from '@app/models/library'
import { useStore, useStoreDeep } from '@app/state/store' import { useStore, useStoreDeep } from '@app/state/store'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import font from '@app/styles/font' import font from '@app/styles/font'
import { GetAlbumList2TypeBase } from '@app/subsonic/params' import { GetAlbumList2Params, GetAlbumList2Type } from '@app/subsonic/params'
import { useNavigation } from '@react-navigation/native' import { useNavigation } from '@react-navigation/native'
import equal from 'fast-deep-equal/es6/react' import React, { useCallback } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet, Text, useWindowDimensions, View } from 'react-native' import { StyleSheet, Text, useWindowDimensions, View } from 'react-native'
const AlbumItem = React.memo<{ const AlbumItem = React.memo<{
album: Album id: string
size: number size: number
height: number height: number
}>(({ album, size, height }) => { }>(({ id, size, height }) => {
const album = useStoreDeep(useCallback(store => store.library.albums[id], [id]))
const navigation = useNavigation() const navigation = useNavigation()
if (!album) { if (!album) {
@@ -31,14 +28,8 @@ const AlbumItem = React.memo<{
album={album} album={album}
menuStyle={[styles.itemMenu, { width: size }]} menuStyle={[styles.itemMenu, { width: size }]}
triggerWrapperStyle={[styles.itemWrapper, { height }]} triggerWrapperStyle={[styles.itemWrapper, { height }]}
onPress={() => navigation.navigate('album', { id: album.id, title: album.name, album })}> onPress={() => navigation.navigate('album', { id: album.id, title: album.name })}>
<CoverArt <CoverArt type="cover" coverArt={album.coverArt} style={{ height: size, width: size }} resizeMode={'cover'} />
type="cover"
coverArt={album.coverArt}
style={{ height: size, width: size }}
resizeMode="cover"
size="thumbnail"
/>
<View style={styles.itemDetails}> <View style={styles.itemDetails}>
<Text style={styles.title} numberOfLines={1}> <Text style={styles.title} numberOfLines={1}>
{album.name} {album.name}
@@ -49,42 +40,64 @@ const AlbumItem = React.memo<{
</View> </View>
</AlbumContextPressable> </AlbumContextPressable>
) )
}, equal)
const AlbumListRenderItem: React.FC<{
item: { album: Album; size: number; height: number }
}> = ({ item }) => <AlbumItem album={item.album} size={item.size} height={item.height} />
const filterValues: GetAlbumList2TypeBase[] = [
'alphabeticalByName', //
'alphabeticalByArtist',
'newest',
'frequent',
'recent',
'starred',
'random',
]
const AlbumFilterButton = withSuspenseMemo(() => {
const { t } = useTranslation()
const filterType = useStoreDeep(store => store.settings.screens.library.albumsFilter.type)
const setFilterType = useStore(store => store.setLibraryAlbumFilterType)
return (
<FilterButton
data={filterValues.map(value => ({ value, text: t(`resources.album.lists.${value}`) }))}
value={filterType}
onSelect={selection => {
setFilterType(selection as GetAlbumList2TypeBase)
}}
title={t('resources.album.lists.sort')}
/>
)
}) })
const AlbumListRenderItem: React.FC<{
item: { id: string; size: number; height: number }
}> = ({ item }) => <AlbumItem id={item.id} size={item.size} height={item.height} />
const filterOptions: OptionData[] = [
{ text: 'By Name', value: 'alphabeticalByName' },
{ text: 'By Artist', value: 'alphabeticalByArtist' },
{ text: 'Newest', value: 'newest' },
{ text: 'Frequent', value: 'frequent' },
{ text: 'Recent', value: 'recent' },
{ text: 'Starred', value: 'starred' },
{ text: 'Random', value: 'random' },
// { text: 'By Year...', value: 'byYear' },
// { text: 'By Genre...', value: 'byGenre' },
]
const AlbumsList = () => { const AlbumsList = () => {
const filterType = useStoreDeep(store => store.settings.screens.library.albumsFilter.type) const filter = useStoreDeep(store => store.settings.screens.library.albumsFilter)
const { isLoading, data, fetchNextPage, refetch } = useQueryAlbumList(filterType as GetAlbumList2TypeBase, 300) const setFilter = useStore(store => store.setLibraryAlbumFilter)
const fetchAlbumList = useStore(store => store.fetchAlbumList)
const fetchPage = useCallback(
(size: number, offset: number) => {
let params: GetAlbumList2Params
switch (filter.type) {
case 'byYear':
params = {
size,
offset,
type: filter.type,
fromYear: filter.fromYear,
toYear: filter.toYear,
}
break
case 'byGenre':
params = {
size,
offset,
type: filter.type,
genre: filter.genre,
}
break
default:
params = {
size,
offset,
type: filter.type,
}
break
}
return fetchAlbumList(params)
},
[fetchAlbumList, filter.fromYear, filter.genre, filter.toYear, filter.type],
)
const { list, refreshing, refresh, fetchNextPage } = useFetchPaginatedList(fetchPage, 300)
const layout = useWindowDimensions() const layout = useWindowDimensions()
@@ -94,19 +107,28 @@ const AlbumsList = () => {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<GradientFlatList <GradientFlatList
data={data ? data.pages.flatMap(albums => albums.map(album => ({ album, size, height }))) : []} data={list.map(id => ({ id, size, height }))}
renderItem={AlbumListRenderItem} renderItem={AlbumListRenderItem}
keyExtractor={item => item.album.id} keyExtractor={item => item.id}
numColumns={3} numColumns={3}
removeClippedSubviews={true} removeClippedSubviews={true}
refreshing={isLoading} refreshing={refreshing}
onRefresh={refetch} onRefresh={refresh}
overScrollMode="never" overScrollMode="never"
onEndReached={() => fetchNextPage()} onEndReached={fetchNextPage}
onEndReachedThreshold={6} onEndReachedThreshold={6}
windowSize={5} windowSize={5}
/> />
<AlbumFilterButton /> <FilterButton
data={filterOptions}
value={filter.type}
onSelect={selection => {
setFilter({
...filter,
type: selection as GetAlbumList2Type,
})
}}
/>
</View> </View>
) )
} }
+28 -37
View File
@@ -1,54 +1,36 @@
import FilterButton from '@app/components/FilterButton' import FilterButton, { OptionData } from '@app/components/FilterButton'
import GradientFlatList from '@app/components/GradientFlatList' import GradientFlatList from '@app/components/GradientFlatList'
import ListItem from '@app/components/ListItem' import ListItem from '@app/components/ListItem'
import { withSuspenseMemo } from '@app/components/withSuspense' import { useFetchList2 } from '@app/hooks/list'
import { useQueryArtists } from '@app/hooks/query'
import { Artist } from '@app/models/library' import { Artist } from '@app/models/library'
import { ArtistFilterType } from '@app/models/settings' import { ArtistFilterType } from '@app/models/settings'
import { useStore, useStoreDeep } from '@app/state/store' import { useStore, useStoreDeep } from '@app/state/store'
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet, View } from 'react-native' import { StyleSheet, View } from 'react-native'
const ArtistRenderItem: React.FC<{ item: Artist }> = ({ item }) => ( const ArtistRenderItem: React.FC<{ item: Artist }> = ({ item }) => (
<ListItem item={item} showArt={true} showStar={false} listStyle="big" style={styles.listItem} /> <ListItem item={item} showArt={true} showStar={false} listStyle="big" style={styles.listItem} />
) )
const filterValues: ArtistFilterType[] = [ const filterOptions: OptionData[] = [
'alphabeticalByName', // { text: 'By Name', value: 'alphabeticalByName' },
'starred', { text: 'Starred', value: 'starred' },
'random', { text: 'Random', value: 'random' },
] ]
const ArtistFilterButton = withSuspenseMemo(() => {
const { t } = useTranslation()
const filterType = useStoreDeep(store => store.settings.screens.library.artistsFilter.type)
const setFilterType = useStore(store => store.setLibraryArtistFilterType)
return (
<FilterButton
data={filterValues.map(value => ({ value, text: t(`resources.artist.lists.${value}`) }))}
value={filterType}
onSelect={selection => setFilterType(selection as ArtistFilterType)}
title={t('resources.artist.lists.sort')}
/>
)
})
const ArtistsList = () => { const ArtistsList = () => {
const filterType = useStore(store => store.settings.screens.library.artistsFilter.type) const fetchArtists = useStore(store => store.fetchArtists)
const { refreshing, refresh } = useFetchList2(fetchArtists)
const artists = useStoreDeep(store => store.library.artists)
const artistOrder = useStoreDeep(store => store.library.artistOrder)
const { isLoading, data, refetch } = useQueryArtists() const filter = useStoreDeep(store => store.settings.screens.library.artistsFilter)
const setFilter = useStore(store => store.setLibraryArtistFiler)
const [sortedList, setSortedList] = useState<Artist[]>([]) const [sortedList, setSortedList] = useState<Artist[]>([])
useEffect(() => { useEffect(() => {
if (!data) { const list = Object.values(artists)
setSortedList([]) switch (filter.type) {
return
}
const list = Object.values(data.byId)
switch (filterType) {
case 'random': case 'random':
setSortedList([...list].sort(() => Math.random() - 0.5)) setSortedList([...list].sort(() => Math.random() - 0.5))
break break
@@ -56,13 +38,13 @@ const ArtistsList = () => {
setSortedList([...list].filter(a => a.starred)) setSortedList([...list].filter(a => a.starred))
break break
case 'alphabeticalByName': case 'alphabeticalByName':
setSortedList(data.allIds.map(id => data.byId[id])) setSortedList(artistOrder.map(id => artists[id]))
break break
default: default:
setSortedList([...list]) setSortedList([...list])
break break
} }
}, [filterType, data]) }, [filter.type, artists, artistOrder])
return ( return (
<View style={styles.container}> <View style={styles.container}>
@@ -70,13 +52,22 @@ const ArtistsList = () => {
data={sortedList} data={sortedList}
renderItem={ArtistRenderItem} renderItem={ArtistRenderItem}
keyExtractor={item => item.id} keyExtractor={item => item.id}
onRefresh={refetch} onRefresh={refresh}
refreshing={isLoading} refreshing={refreshing}
overScrollMode="never" overScrollMode="never"
windowSize={3} windowSize={3}
contentMarginTop={6} contentMarginTop={6}
/> />
<ArtistFilterButton /> <FilterButton
data={filterOptions}
value={filter.type}
onSelect={selection => {
setFilter({
...filter,
type: selection as ArtistFilterType,
})
}}
/>
</View> </View>
) )
} }
+8 -6
View File
@@ -1,8 +1,8 @@
import GradientFlatList from '@app/components/GradientFlatList' import GradientFlatList from '@app/components/GradientFlatList'
import ListItem from '@app/components/ListItem' import ListItem from '@app/components/ListItem'
import { useQueryPlaylists } from '@app/hooks/query' import { useFetchList2 } from '@app/hooks/list'
import { Playlist } from '@app/models/library' import { Playlist } from '@app/models/library'
import { mapById } from '@app/util/state' import { useStore, useStoreDeep } from '@app/state/store'
import React from 'react' import React from 'react'
import { StyleSheet } from 'react-native' import { StyleSheet } from 'react-native'
@@ -11,15 +11,17 @@ const PlaylistRenderItem: React.FC<{ item: Playlist }> = ({ item }) => (
) )
const PlaylistsList = () => { const PlaylistsList = () => {
const { isLoading, data, refetch } = useQueryPlaylists() const fetchPlaylists = useStore(store => store.fetchPlaylists)
const { refreshing, refresh } = useFetchList2(fetchPlaylists)
const playlists = useStoreDeep(store => store.library.playlists)
return ( return (
<GradientFlatList <GradientFlatList
data={data ? mapById(data?.byId, data?.allIds) : []} data={Object.values(playlists)}
renderItem={PlaylistRenderItem} renderItem={PlaylistRenderItem}
keyExtractor={item => item.id} keyExtractor={item => item.id}
onRefresh={refetch} onRefresh={refresh}
refreshing={isLoading} refreshing={refreshing}
overScrollMode="never" overScrollMode="never"
windowSize={5} windowSize={5}
contentMarginTop={6} contentMarginTop={6}
+2 -2
View File
@@ -3,8 +3,7 @@ import ListItem from '@app/components/ListItem'
import NowPlayingBar from '@app/components/NowPlayingBar' import NowPlayingBar from '@app/components/NowPlayingBar'
import { useSkipTo } from '@app/hooks/trackplayer' import { useSkipTo } from '@app/hooks/trackplayer'
import { Song } from '@app/models/library' import { Song } from '@app/models/library'
import { mapTrackExtToSong } from '@app/models/map' import { useStore, useStoreDeep } from '@app/state/store'
import { useStoreDeep } from '@app/state/store'
import React from 'react' import React from 'react'
import { StyleSheet, View } from 'react-native' import { StyleSheet, View } from 'react-native'
@@ -27,6 +26,7 @@ const SongRenderItem: React.FC<{
const NowPlayingQueue = React.memo<{}>(() => { const NowPlayingQueue = React.memo<{}>(() => {
const queue = useStoreDeep(store => store.queue) const queue = useStoreDeep(store => store.queue)
const mapTrackExtToSong = useStore(store => store.mapTrackExtToSong)
const skipTo = useSkipTo() const skipTo = useSkipTo()
return ( return (
+21 -20
View File
@@ -3,10 +3,8 @@ import HeaderBar from '@app/components/HeaderBar'
import ImageGradientBackground from '@app/components/ImageGradientBackground' import ImageGradientBackground from '@app/components/ImageGradientBackground'
import PressableOpacity from '@app/components/PressableOpacity' import PressableOpacity from '@app/components/PressableOpacity'
import { PressableStar } from '@app/components/Star' import { PressableStar } from '@app/components/Star'
import { withSuspenseMemo } from '@app/components/withSuspense'
import { useNext, usePause, usePlay, usePrevious, useSeekTo } from '@app/hooks/trackplayer' import { useNext, usePause, usePlay, usePrevious, useSeekTo } from '@app/hooks/trackplayer'
import { mapTrackExtToSong } from '@app/models/map' import { QueueContextType, TrackExt } from '@app/models/trackplayer'
import { TrackExt } from '@app/models/trackplayer'
import { useStore, useStoreDeep } from '@app/state/store' import { useStore, useStoreDeep } from '@app/state/store'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import font from '@app/styles/font' import font from '@app/styles/font'
@@ -14,7 +12,6 @@ import formatDuration from '@app/util/formatDuration'
import Slider from '@react-native-community/slider' import Slider from '@react-native-community/slider'
import { useNavigation } from '@react-navigation/native' import { useNavigation } from '@react-navigation/native'
import React, { useCallback, useEffect, useState } from 'react' import React, { useCallback, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { ActivityIndicator, StyleSheet, Text, TextStyle, View } from 'react-native' import { ActivityIndicator, StyleSheet, Text, TextStyle, View } from 'react-native'
import { NativeStackScreenProps } from 'react-native-screens/native-stack' import { NativeStackScreenProps } from 'react-native-screens/native-stack'
import { RepeatMode, State } from 'react-native-track-player' import { RepeatMode, State } from 'react-native-track-player'
@@ -23,29 +20,33 @@ import IconFA5 from 'react-native-vector-icons/FontAwesome5'
import Icon from 'react-native-vector-icons/Ionicons' import Icon from 'react-native-vector-icons/Ionicons'
import IconMatCom from 'react-native-vector-icons/MaterialCommunityIcons' import IconMatCom from 'react-native-vector-icons/MaterialCommunityIcons'
const NowPlayingHeader = withSuspenseMemo<{ function getContextName(type?: QueueContextType) {
switch (type) {
case 'album':
return 'Album'
case 'artist':
return 'Top Songs'
case 'playlist':
return 'Playlist'
case 'song':
return 'Search Results'
default:
return undefined
}
}
const NowPlayingHeader = React.memo<{
track?: TrackExt track?: TrackExt
}>(({ track }) => { }>(({ track }) => {
const queueName = useStore(store => store.queueName) const queueName = useStore(store => store.queueName)
const queueContextType = useStore(store => store.queueContextType) const queueContextType = useStore(store => store.queueContextType)
const { t } = useTranslation() const mapTrackExtToSong = useStore(store => store.mapTrackExtToSong)
console.log(t('resources.album.name', { count: 1 }))
if (!track) { if (!track) {
return <></> return <></>
} }
let contextName: string let contextName = getContextName(queueContextType)
if (queueContextType === 'album') {
contextName = t('resources.album.name', { count: 1 })
} else if (queueContextType === 'artist') {
contextName = t('resources.song.lists.artistTopSongs')
} else if (queueContextType === 'playlist') {
contextName = t('resources.playlist.name', { count: 1 })
} else if (queueContextType === 'song') {
contextName = t('search.nowPlayingContext')
}
return ( return (
<HeaderBar <HeaderBar
@@ -90,11 +91,11 @@ const headerStyles = StyleSheet.create({
}) })
const SongCoverArt = () => { const SongCoverArt = () => {
const albumId = useStore(store => store.currentTrack?.albumId) const coverArt = useStore(store => store.currentTrack?.coverArt)
return ( return (
<View style={coverArtStyles.container}> <View style={coverArtStyles.container}>
<CoverArt type="album" size="original" albumId={albumId} style={coverArtStyles.image} /> <CoverArt type="cover" size="original" coverArt={coverArt} style={coverArtStyles.image} />
</View> </View>
) )
} }
+74 -79
View File
@@ -4,51 +4,65 @@ import Header from '@app/components/Header'
import ListItem from '@app/components/ListItem' import ListItem from '@app/components/ListItem'
import NothingHere from '@app/components/NothingHere' import NothingHere from '@app/components/NothingHere'
import TextInput from '@app/components/TextInput' import TextInput from '@app/components/TextInput'
import { withSuspense, withSuspenseMemo } from '@app/components/withSuspense' import { useActiveServerRefresh } from '@app/hooks/settings'
import { useQuerySearchResults } from '@app/hooks/query' import { Song, Album, Artist, SearchResults } from '@app/models/library'
import { useSetQueue } from '@app/hooks/trackplayer' import { useStore, useStoreDeep } from '@app/state/store'
import { Album, Artist, SearchResults, Song } from '@app/models/library'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import font from '@app/styles/font' import font from '@app/styles/font'
import { mapById } from '@app/util/state'
import { useFocusEffect, useNavigation } from '@react-navigation/native' import { useFocusEffect, useNavigation } from '@react-navigation/native'
import equal from 'fast-deep-equal/es6/react' import debounce from 'lodash.debounce'
import _ from 'lodash'
import React, { useCallback, useMemo, useRef, useState } from 'react' import React, { useCallback, useMemo, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { import {
ActivityIndicator, ActivityIndicator,
InteractionManager, InteractionManager,
ScrollView, ScrollView,
StatusBar,
StyleSheet, StyleSheet,
TextInput as ReactTextInput, TextInput as ReactTextInput,
View, View,
} from 'react-native' } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
const SongItem = React.memo<{ item: Song }>(({ item }) => { const SongItem = React.memo<{ item: Song }>(({ item }) => {
const { setQueue, contextId } = useSetQueue('song', [item]) const setQueue = useStore(store => store.setQueue)
return ( return (
<ListItem <ListItem
item={item} item={item}
contextId={contextId} contextId={item.id}
queueId={0} queueId={0}
showArt={true} showArt={true}
showStar={false} showStar={false}
onPress={() => setQueue({ title: item.title, playTrack: 0 })} onPress={() => setQueue([item], item.title, 'song', item.id, 0)}
/> />
) )
}, equal) })
const ResultsCategory = withSuspenseMemo<{ const ResultsCategory = React.memo<{
name: string name: string
query: string query: string
items: (Artist | Album | Song)[] ids: string[]
type: 'artist' | 'album' | 'song' type: 'artist' | 'album' | 'song'
}>( }>(({ name, query, type, ids }) => {
({ name, query, type, items }) => { const items: (Album | Artist | Song)[] = useStoreDeep(
useCallback(
store => {
switch (type) {
case 'album':
return mapById(store.library.albums, ids)
case 'artist':
return mapById(store.library.artists, ids)
case 'song':
return mapById(store.library.songs, ids)
default:
return []
}
},
[ids, type],
),
)
const navigation = useNavigation() const navigation = useNavigation()
const { t } = useTranslation()
if (items.length === 0) { if (items.length === 0) {
return <></> return <></>
@@ -66,7 +80,7 @@ const ResultsCategory = withSuspenseMemo<{
)} )}
{items.length === 5 && ( {items.length === 5 && (
<Button <Button
title={t('search.moreResults')} title="More..."
buttonStyle="hollow" buttonStyle="hollow"
style={styles.more} style={styles.more}
onPress={() => navigation.navigate('results', { query, type: items[0].itemType })} onPress={() => navigation.navigate('results', { query, type: items[0].itemType })}
@@ -74,120 +88,101 @@ const ResultsCategory = withSuspenseMemo<{
)} )}
</> </>
) )
}, })
null,
equal,
)
const Results = withSuspenseMemo<{ const Results = React.memo<{
results: SearchResults results: SearchResults
query: string query: string
}>( }>(({ results, query }) => {
({ results, query }) => {
const { t } = useTranslation()
return ( return (
<> <>
<ResultsCategory <ResultsCategory name="Artists" query={query} type={'artist'} ids={results.artists} />
name={t('resources.artist.name', { count: 2 })} <ResultsCategory name="Albums" query={query} type={'album'} ids={results.albums} />
query={query} <ResultsCategory name="Songs" query={query} type={'song'} ids={results.songs} />
type={'artist'}
items={results.artists}
/>
<ResultsCategory
name={t('resources.album.name', { count: 2 })}
query={query}
type={'album'}
items={results.albums}
/>
<ResultsCategory
name={t('resources.song.name', { count: 2 })}
query={query}
type={'song'}
items={results.songs}
/>
</> </>
) )
}, })
null,
equal,
)
const Search = withSuspense(() => {
const [query, setQuery] = useState('')
const { data, isLoading } = useQuerySearchResults({ query, albumCount: 5, artistCount: 5, songCount: 5 })
const { t } = useTranslation()
const Search = () => {
const fetchSearchResults = useStore(store => store.fetchSearchResults)
const [results, setResults] = useState<SearchResults>({ artists: [], albums: [], songs: [] })
const [refreshing, setRefreshing] = useState(false)
const [text, setText] = useState('') const [text, setText] = useState('')
const searchBarRef = useRef<ReactTextInput>(null) const searchBarRef = useRef<ReactTextInput>(null)
const scrollRef = useRef<ScrollView>(null) const scrollRef = useRef<ScrollView>(null)
const paddingTop = useSafeAreaInsets().top
useFocusEffect( useFocusEffect(
useCallback(() => { useCallback(() => {
const task = InteractionManager.runAfterInteractions(() => { const task = InteractionManager.runAfterInteractions(() => {
setTimeout(() => { setTimeout(() => {
if (text) {
return
}
setText('') setText('')
setQuery('') setResults({ artists: [], albums: [], songs: [] })
searchBarRef.current?.focus() searchBarRef.current?.focus()
scrollRef.current?.scrollTo({ y: 0, animated: true }) scrollRef.current?.scrollTo({ y: 0, animated: true })
}, 50) }, 50)
}) })
return () => task.cancel() return () => task.cancel()
}, [text]), }, [searchBarRef, scrollRef]),
) )
const debouncedSetQuery = useMemo( useActiveServerRefresh(
useCallback(() => {
setText('')
setResults({ artists: [], albums: [], songs: [] })
}, []),
)
const debouncedonUpdateSearch = useMemo(
() => () =>
_.debounce((value: string) => { debounce(async (query: string) => {
setQuery(value) setRefreshing(true)
setResults(await fetchSearchResults({ query, albumCount: 5, artistCount: 5, songCount: 5 }))
setRefreshing(false)
}, 400), }, 400),
[], [fetchSearchResults],
) )
const onChangeText = useCallback( const onChangeText = useCallback(
(value: string) => { (value: string) => {
setText(value) setText(value)
debouncedSetQuery(value) debouncedonUpdateSearch(value)
}, },
[setText, debouncedSetQuery], [setText, debouncedonUpdateSearch],
) )
const resultsCount = const resultsCount = results.albums.length + results.artists.length + results.songs.length
(data ? data.pages.reduce((acc, val) => (acc += val.artists.length), 0) : 0) +
(data ? data.pages.reduce((acc, val) => (acc += val.albums.length), 0) : 0) +
(data ? data.pages.reduce((acc, val) => (acc += val.songs.length), 0) : 0)
return ( return (
<GradientScrollView ref={scrollRef} style={styles.scroll} contentContainerStyle={{ paddingTop }}> <GradientScrollView ref={scrollRef} style={styles.scroll} contentContainerStyle={styles.scrollContentContainer}>
<View style={styles.content}> <View style={styles.content}>
<View style={styles.inputBar}> <View style={styles.inputBar}>
<TextInput <TextInput
ref={searchBarRef} ref={searchBarRef}
style={styles.textInput} style={styles.textInput}
placeholder={t('search.inputPlaceholder')} placeholder="Search"
value={text} value={text}
onChangeText={onChangeText} onChangeText={onChangeText}
/> />
<ActivityIndicator animating={isLoading} size="small" color={colors.text.secondary} style={styles.activity} /> <ActivityIndicator
animating={refreshing}
size="small"
color={colors.text.secondary}
style={styles.activity}
/>
</View> </View>
{data !== undefined && resultsCount > 0 ? ( {resultsCount > 0 ? <Results results={results} query={text} /> : <NothingHere style={styles.noResults} />}
<Results results={data.pages[0]} query={text} />
) : (
<NothingHere style={styles.noResults} />
)}
</View> </View>
</GradientScrollView> </GradientScrollView>
) )
}) }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
scroll: { scroll: {
flex: 1, flex: 1,
}, },
scrollContentContainer: {
paddingTop: StatusBar.currentHeight,
},
content: { content: {
paddingHorizontal: 20, paddingHorizontal: 20,
paddingBottom: 20, paddingBottom: 20,
+64 -50
View File
@@ -1,35 +1,24 @@
import GradientFlatList from '@app/components/GradientFlatList' import GradientFlatList from '@app/components/GradientFlatList'
import ListItem from '@app/components/ListItem' import ListItem from '@app/components/ListItem'
import { withSuspense } from '@app/components/withSuspense' import { useFetchPaginatedList } from '@app/hooks/list'
import { useQuerySearchResults } from '@app/hooks/query'
import { useSetQueue } from '@app/hooks/trackplayer'
import { Album, Artist, Song } from '@app/models/library' import { Album, Artist, Song } from '@app/models/library'
import { useStore, useStoreDeep } from '@app/state/store'
import { Search3Params } from '@app/subsonic/params' import { Search3Params } from '@app/subsonic/params'
import { mapById } from '@app/util/state'
import { useNavigation } from '@react-navigation/native' import { useNavigation } from '@react-navigation/native'
import React, { useEffect } from 'react' import React, { useCallback, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet } from 'react-native' import { StyleSheet } from 'react-native'
type SearchListItemType = Album | Song | Artist type SearchListItemType = Album | Song | Artist
const SongResultsListItem: React.FC<{ item: Song }> = ({ item }) => { const ResultsListItem: React.FC<{ item: SearchListItemType }> = ({ item }) => {
const { setQueue, contextId } = useSetQueue('song', [item]) const setQueue = useStore(store => store.setQueue)
return ( let onPress
<ListItem if (item.itemType === 'song') {
item={item} onPress = () => setQueue([item], item.title, 'song', item.id, 0)
contextId={contextId}
queueId={0}
showArt={true}
showStar={false}
listStyle="small"
onPress={() => setQueue({ title: item.title, playTrack: 0 })}
style={styles.listItem}
/>
)
} }
const OtherResultsListItem: React.FC<{ item: SearchListItemType }> = ({ item }) => {
return ( return (
<ListItem <ListItem
item={item} item={item}
@@ -38,53 +27,78 @@ const OtherResultsListItem: React.FC<{ item: SearchListItemType }> = ({ item })
showArt={true} showArt={true}
showStar={false} showStar={false}
listStyle="small" listStyle="small"
onPress={onPress}
style={styles.listItem} style={styles.listItem}
/> />
) )
} }
const ResultsListItem: React.FC<{ item: SearchListItemType }> = ({ item }) => {
if (item.itemType === 'song') {
return <SongResultsListItem item={item} />
} else {
return <OtherResultsListItem item={item} />
}
}
const SearchResultsRenderItem: React.FC<{ item: SearchListItemType }> = ({ item }) => <ResultsListItem item={item} /> const SearchResultsRenderItem: React.FC<{ item: SearchListItemType }> = ({ item }) => <ResultsListItem item={item} />
const SearchResultsView = withSuspense<{ const SearchResultsView: React.FC<{
query: string query: string
type: 'album' | 'artist' | 'song' type: 'album' | 'artist' | 'song'
}>(({ query, type }) => { }> = ({ query, type }) => {
const navigation = useNavigation() const navigation = useNavigation()
const { t } = useTranslation() const fetchSearchResults = useStore(store => store.fetchSearchResults)
const { list, refreshing, refresh, fetchNextPage } = useFetchPaginatedList(
const size = 100 useCallback(
async (size, offset) => {
const params: Search3Params = { query } const params: Search3Params = { query }
if (type === 'album') { if (type === 'album') {
params.albumCount = size params.albumCount = size
params.albumOffset = offset
} else if (type === 'artist') { } else if (type === 'artist') {
params.artistCount = size params.artistCount = size
} else { params.artistOffset = offset
} else if (type === 'song') {
params.songCount = size params.songCount = size
} params.songOffset = offset
const { data, isLoading, refetch, fetchNextPage } = useQuerySearchResults(params)
const items: (Artist | Album | Song)[] = []
if (type === 'album') {
data && items.push(...data.pages.flatMap(p => p.albums))
} else if (type === 'artist') {
data && items.push(...data.pages.flatMap(p => p.artists))
} else { } else {
data && items.push(...data.pages.flatMap(p => p.songs)) params.albumCount = 5
params.artistCount = 5
params.songCount = 5
} }
const results = await fetchSearchResults(params)
switch (type) {
case 'album':
return results.albums
case 'artist':
return results.artists
case 'song':
return results.songs
default:
return []
}
},
[fetchSearchResults, query, type],
),
100,
)
const items: SearchListItemType[] = useStoreDeep(
useCallback(
store => {
switch (type) {
case 'album':
return mapById(store.library.albums, list)
case 'artist':
return mapById(store.library.artists, list)
case 'song':
return mapById(store.library.songs, list)
default:
return []
}
},
[list, type],
),
)
useEffect(() => { useEffect(() => {
navigation.setOptions({ navigation.setOptions({
title: t('search.headerTitle', { query }), title: `Search: "${query}"`,
}) })
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []) }, [])
@@ -94,17 +108,17 @@ const SearchResultsView = withSuspense<{
data={items} data={items}
renderItem={SearchResultsRenderItem} renderItem={SearchResultsRenderItem}
keyExtractor={(item, i) => i.toString()} keyExtractor={(item, i) => i.toString()}
onRefresh={refetch} onRefresh={refresh}
refreshing={isLoading} refreshing={refreshing}
overScrollMode="never" overScrollMode="never"
onEndReached={() => fetchNextPage} onEndReached={fetchNextPage}
removeClippedSubviews={true} removeClippedSubviews={true}
onEndReachedThreshold={2} onEndReachedThreshold={2}
contentMarginTop={6} contentMarginTop={6}
windowSize={5} windowSize={5}
/> />
) )
}) }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
listItem: { listItem: {
+50 -44
View File
@@ -1,7 +1,5 @@
import Button from '@app/components/Button' import Button from '@app/components/Button'
import GradientScrollView from '@app/components/GradientScrollView' import GradientScrollView from '@app/components/GradientScrollView'
import SettingsSwitch from '@app/components/SettingsSwitch'
import { withSuspense } from '@app/components/withSuspense'
import { Server } from '@app/models/settings' import { Server } from '@app/models/settings'
import { useStore, useStoreDeep } from '@app/state/store' import { useStore, useStoreDeep } from '@app/state/store'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
@@ -9,18 +7,16 @@ import font from '@app/styles/font'
import toast from '@app/util/toast' import toast from '@app/util/toast'
import { useNavigation } from '@react-navigation/native' import { useNavigation } from '@react-navigation/native'
import md5 from 'md5' import md5 from 'md5'
import React, { useCallback, useEffect, useState } from 'react' import React, { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet, Text, TextInput, View, ViewStyle } from 'react-native' import { StyleSheet, Text, TextInput, View, ViewStyle } from 'react-native'
import uuid from 'react-native-uuid' import { v4 as uuidv4 } from 'uuid'
import SettingsSwitch from '@app/components/SettingsSwitch'
const PASSWORD_PLACEHOLDER = 'PASSWORD_PLACEHOLDER' const PASSWORD_PLACEHOLDER = 'PASSWORD_PLACEHOLDER'
const ServerView = withSuspense<{ const ServerView: React.FC<{
id?: string id?: string
title?: string }> = ({ id }) => {
}>(({ id, title }) => {
const { t } = useTranslation()
const navigation = useNavigation() const navigation = useNavigation()
const activeServerId = useStore(store => store.settings.activeServerId) const activeServerId = useStore(store => store.settings.activeServerId)
const servers = useStoreDeep(store => store.settings.servers) const servers = useStoreDeep(store => store.settings.servers)
@@ -39,10 +35,8 @@ const ServerView = withSuspense<{
) )
const [testing, setTesting] = useState(false) const [testing, setTesting] = useState(false)
const [removing, setRemoving] = useState(false)
useEffect(() => { const [saving, setSaving] = useState(false)
navigation.setOptions({ title })
}, [navigation, title])
const validate = useCallback(() => { const validate = useCallback(() => {
return !!address && !!username && !!password return !!address && !!username && !!password
@@ -63,7 +57,7 @@ const ServerView = withSuspense<{
const createServer = useCallback<() => Server>(() => { const createServer = useCallback<() => Server>(() => {
if (usePlainPassword) { if (usePlainPassword) {
return { return {
id: server?.id || '', id: server?.id || uuidv4(),
usePlainPassword, usePlainPassword,
plainPassword: password, plainPassword: password,
address, address,
@@ -78,12 +72,12 @@ const ServerView = withSuspense<{
salt = server.salt salt = server.salt
token = server.token token = server.token
} else { } else {
salt = uuid.v4() as string salt = uuidv4()
token = md5(password + salt) token = md5(password + salt)
} }
return { return {
id: server?.id || '', id: server?.id || uuidv4(),
address, address,
username, username,
usePlainPassword, usePlainPassword,
@@ -97,15 +91,22 @@ const ServerView = withSuspense<{
return return
} }
setSaving(true)
const update = createServer() const update = createServer()
const waitForSave = async () => {
try {
if (id) { if (id) {
updateServer(update) updateServer(update)
} else { } else {
addServer(update) await addServer(update)
} }
exit() exit()
} catch (err) {
setSaving(false)
}
}
waitForSave()
}, [addServer, createServer, exit, id, updateServer, validate]) }, [addServer, createServer, exit, id, updateServer, validate])
const remove = useCallback(() => { const remove = useCallback(() => {
@@ -113,8 +114,16 @@ const ServerView = withSuspense<{
return return
} }
removeServer(id as string) setRemoving(true)
const waitForRemove = async () => {
try {
await removeServer(id as string)
exit() exit()
} catch (err) {
setRemoving(false)
}
}
waitForRemove()
}, [canRemove, exit, id, removeServer]) }, [canRemove, exit, id, removeServer])
const togglePlainPassword = useCallback( const togglePlainPassword = useCallback(
@@ -142,20 +151,19 @@ const ServerView = withSuspense<{
const ping = async () => { const ping = async () => {
const res = await pingServer(potential) const res = await pingServer(potential)
toast( if (res) {
t(`settings.servers.messages.${res ? 'connectionOk' : 'connectionFailed'}`, { toast(`Connection to ${potential.address} OK!`)
address: potential.address, } else {
interpolation: { escapeValue: false }, toast(`Connection to ${potential.address} failed, check settings or server`)
}), }
)
setTesting(false) setTesting(false)
} }
ping() ping()
}, [createServer, pingServer, t]) }, [createServer, pingServer])
const disableControls = useCallback(() => { const disableControls = useCallback(() => {
return !validate() || testing return !validate() || testing || removing || saving
}, [validate, testing]) }, [validate, testing, removing, saving])
const formatAddress = useCallback(() => { const formatAddress = useCallback(() => {
let addressFormatted = address.trim() let addressFormatted = address.trim()
@@ -176,9 +184,9 @@ const ServerView = withSuspense<{
} }
return ( return (
<GradientScrollView style={styles.scroll}> <GradientScrollView style={styles.scroll} contentContainerStyle={styles.scrollContentContainer}>
<View style={styles.content}> <View style={styles.content}>
<Text style={styles.inputTitle}>{t('settings.servers.fields.address')}</Text> <Text style={styles.inputTitle}>Address</Text>
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholderTextColor="grey" placeholderTextColor="grey"
@@ -191,7 +199,7 @@ const ServerView = withSuspense<{
onChangeText={setAddress} onChangeText={setAddress}
onBlur={formatAddress} onBlur={formatAddress}
/> />
<Text style={styles.inputTitle}>{t('settings.servers.fields.username')}</Text> <Text style={styles.inputTitle}>Username</Text>
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholderTextColor="grey" placeholderTextColor="grey"
@@ -204,7 +212,7 @@ const ServerView = withSuspense<{
value={username} value={username}
onChangeText={setUsername} onChangeText={setUsername}
/> />
<Text style={styles.inputTitle}>{t('settings.servers.fields.password')}</Text> <Text style={styles.inputTitle}>Password</Text>
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholderTextColor="grey" placeholderTextColor="grey"
@@ -219,11 +227,11 @@ const ServerView = withSuspense<{
onChangeText={setPassword} onChangeText={setPassword}
/> />
<SettingsSwitch <SettingsSwitch
title={t('settings.servers.options.forcePlaintextPassword.title')} title="Force plain text password"
subtitle={ subtitle={
usePlainPassword usePlainPassword
? t('settings.servers.options.forcePlaintextPassword.descriptionOn') ? 'Send password in plain text (legacy, make sure your connection is secure!)'
: t('settings.servers.options.forcePlaintextPassword.descriptionOff') : 'Send password as token + salt'
} }
value={usePlainPassword} value={usePlainPassword}
setValue={togglePlainPassword} setValue={togglePlainPassword}
@@ -231,31 +239,29 @@ const ServerView = withSuspense<{
<Button <Button
disabled={disableControls()} disabled={disableControls()}
style={styles.button} style={styles.button}
title={t('settings.servers.actions.testConnection')} title="Test Connection"
buttonStyle="hollow" buttonStyle="hollow"
onPress={test} onPress={test}
/> />
<Button <Button
disabled={disableControls()} disabled={disableControls()}
style={[styles.button, styles.delete, deleteStyle]} style={[styles.button, styles.delete, deleteStyle]}
title={t('settings.servers.actions.delete')} title="Delete"
onPress={remove} onPress={remove}
/> />
<Button <Button disabled={disableControls()} style={styles.button} title="Save" onPress={save} />
disabled={disableControls()}
style={styles.button}
title={t('settings.servers.actions.save')}
onPress={save}
/>
</View> </View>
</GradientScrollView> </GradientScrollView>
) )
}) }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
scroll: { scroll: {
flex: 1, flex: 1,
}, },
scrollContentContainer: {
// paddingTop: StatusBar.currentHeight,
},
content: { content: {
paddingHorizontal: 20, paddingHorizontal: 20,
}, },
+68 -70
View File
@@ -5,28 +5,24 @@ import PressableOpacity from '@app/components/PressableOpacity'
import SettingsItem from '@app/components/SettingsItem' import SettingsItem from '@app/components/SettingsItem'
import SettingsSwitch from '@app/components/SettingsSwitch' import SettingsSwitch from '@app/components/SettingsSwitch'
import TextInput from '@app/components/TextInput' import TextInput from '@app/components/TextInput'
import { withSuspenseMemo } from '@app/components/withSuspense' import { useSwitchActiveServer } from '@app/hooks/settings'
import { useResetImageCache, useSwitchActiveServer } from '@app/hooks/settings'
import { Server } from '@app/models/settings' import { Server } from '@app/models/settings'
import { useStore, useStoreDeep } from '@app/state/store' import { useStore, useStoreDeep } from '@app/state/store'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import font from '@app/styles/font' import font from '@app/styles/font'
import { useNavigation } from '@react-navigation/core' import { useNavigation } from '@react-navigation/core'
import React, { useCallback, useState } from 'react' import React, { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next' import { KeyboardTypeOptions, Linking, Modal, Pressable, StatusBar, StyleSheet, Text, View } from 'react-native'
import { KeyboardTypeOptions, Linking, Modal, Pressable, StyleSheet, Text, View } from 'react-native'
import { ScrollView } from 'react-native-gesture-handler' import { ScrollView } from 'react-native-gesture-handler'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import Icon from 'react-native-vector-icons/MaterialCommunityIcons' import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
import { version } from '../../package.json' import { version } from '../../package.json'
const ServerItem = withSuspenseMemo<{ const ServerItem = React.memo<{
server: Server server: Server
}>(({ server }) => { }>(({ server }) => {
const activeServerId = useStore(store => store.settings.activeServerId) const activeServerId = useStore(store => store.settings.activeServerId)
const switchActiveServer = useSwitchActiveServer() const switchActiveServer = useSwitchActiveServer()
const navigation = useNavigation() const navigation = useNavigation()
const { t } = useTranslation()
const setActive = useCallback(() => { const setActive = useCallback(() => {
switchActiveServer(server.id) switchActiveServer(server.id)
@@ -36,7 +32,7 @@ const ServerItem = withSuspenseMemo<{
<SettingsItem <SettingsItem
title={server.address} title={server.address}
subtitle={server.username} subtitle={server.username}
onPress={() => navigation.navigate('server', { id: server.id, title: t('settings.servers.actions.edit') })}> onPress={() => navigation.navigate('server', { id: server.id })}>
<PressableOpacity style={styles.serverActive} onPress={setActive}> <PressableOpacity style={styles.serverActive} onPress={setActive}>
{activeServerId === server.id ? ( {activeServerId === server.id ? (
<Icon name="checkbox-marked-circle" size={30} color={colors.accent} /> <Icon name="checkbox-marked-circle" size={30} color={colors.accent} />
@@ -76,27 +72,25 @@ const ModalChoice = React.memo<{
) )
}) })
const BitrateModal = withSuspenseMemo<{ function bitrateString(bitrate: number): string {
return bitrate === 0 ? 'Unlimited' : `${bitrate}kbps`
}
const BitrateModal = React.memo<{
title: string title: string
bitrate: number bitrate: number
setBitrate: (bitrate: number) => void setBitrate: (bitrate: number) => void
}>(({ title, bitrate, setBitrate }) => { }>(({ title, bitrate, setBitrate }) => {
const { t } = useTranslation()
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
const toggleModal = useCallback(() => setVisible(!visible), [visible]) const toggleModal = useCallback(() => setVisible(!visible), [visible])
const bitrateText = useCallback(
(value: number) =>
value === 0 ? t('settings.network.values.unlimitedKbps') : t('settings.network.values.kbps', { value }),
[t],
)
const BitrateChoice: React.FC<{ value: number }> = useCallback( const BitrateChoice: React.FC<{ value: number }> = useCallback(
({ value }) => { ({ value }) => {
const text = bitrateString(value)
return ( return (
<ModalChoice <ModalChoice
text={bitrateText(value)} text={text}
value={value} value={value}
setValue={setBitrate} setValue={setBitrate}
closeModal={toggleModal} closeModal={toggleModal}
@@ -104,12 +98,12 @@ const BitrateModal = withSuspenseMemo<{
/> />
) )
}, },
[bitrate, toggleModal, setBitrate, bitrateText], [bitrate, toggleModal, setBitrate],
) )
return ( return (
<> <>
<SettingsItem title={title} subtitle={bitrateText(bitrate)} onPress={toggleModal} /> <SettingsItem title={title} subtitle={bitrateString(bitrate)} onPress={toggleModal} />
<Modal animationType="fade" transparent={true} visible={visible} onRequestClose={toggleModal}> <Modal animationType="fade" transparent={true} visible={visible} onRequestClose={toggleModal}>
<Pressable style={styles.modalBackdrop} onPress={toggleModal}> <Pressable style={styles.modalBackdrop} onPress={toggleModal}>
<View style={styles.centeredView}> <View style={styles.centeredView}>
@@ -140,9 +134,9 @@ const SettingsTextModal = React.memo<{
title: string title: string
value: string value: string
setValue: (text: string) => void setValue: (text: string) => void
subtitle: (value: string) => string getUnit?: (text: string) => string
keyboardType?: KeyboardTypeOptions keyboardType?: KeyboardTypeOptions
}>(({ title, value, setValue, subtitle, keyboardType }) => { }>(({ title, value, setValue, getUnit, keyboardType }) => {
const [visible, setVisible] = useState(false) const [visible, setVisible] = useState(false)
const [inputText, setInputText] = useState(value) const [inputText, setInputText] = useState(value)
@@ -153,9 +147,16 @@ const SettingsTextModal = React.memo<{
toggleModal() toggleModal()
}, [inputText, setValue, toggleModal]) }, [inputText, setValue, toggleModal])
const getSubtitle = useCallback(() => {
if (!getUnit) {
return value
}
return value + ' ' + getUnit(value)
}, [getUnit, value])
return ( return (
<> <>
<SettingsItem title={title} subtitle={subtitle(value)} onPress={toggleModal} /> <SettingsItem title={title} subtitle={getSubtitle()} onPress={toggleModal} />
<Modal animationType="fade" transparent={true} visible={visible} onRequestClose={toggleModal}> <Modal animationType="fade" transparent={true} visible={visible} onRequestClose={toggleModal}>
<Pressable style={styles.modalBackdrop} onPress={toggleModal}> <Pressable style={styles.modalBackdrop} onPress={toggleModal}>
<View style={styles.centeredView}> <View style={styles.centeredView}>
@@ -181,9 +182,15 @@ const SettingsTextModal = React.memo<{
) )
}) })
const SettingsContent = withSuspenseMemo(() => { function secondsUnit(seconds: string): string {
const { t } = useTranslation() const numberValue = parseFloat(seconds)
if (Math.abs(numberValue) !== 1) {
return 'seconds'
}
return 'second'
}
const SettingsContent = React.memo(() => {
const servers = useStoreDeep(store => store.settings.servers) const servers = useStoreDeep(store => store.settings.servers)
const scrobble = useStore(store => store.settings.scrobble) const scrobble = useStore(store => store.settings.scrobble)
const setScrobble = useStore(store => store.setScrobble) const setScrobble = useStore(store => store.setScrobble)
@@ -199,99 +206,89 @@ const SettingsContent = withSuspenseMemo(() => {
const maxBuffer = useStore(store => store.settings.maxBuffer) const maxBuffer = useStore(store => store.settings.maxBuffer)
const setMaxBuffer = useStore(store => store.setMaxBuffer) const setMaxBuffer = useStore(store => store.setMaxBuffer)
const clearImageCache = useStore(store => store.clearImageCache)
const [clearing, setClearing] = useState(false) const [clearing, setClearing] = useState(false)
const resetImageCache = useResetImageCache()
const navigation = useNavigation() const navigation = useNavigation()
const clear = useCallback(async () => { const clear = useCallback(() => {
setClearing(true) setClearing(true)
await resetImageCache()
const waitForClear = async () => {
try {
await clearImageCache()
} catch (err) {
console.log(err)
} finally {
setClearing(false) setClearing(false)
}, [resetImageCache]) }
}
waitForClear()
}, [clearImageCache])
const setMinBufferText = useCallback((text: string) => setMinBuffer(parseFloat(text)), [setMinBuffer]) const setMinBufferText = useCallback((text: string) => setMinBuffer(parseFloat(text)), [setMinBuffer])
const setMaxBufferText = useCallback((text: string) => setMaxBuffer(parseFloat(text)), [setMaxBuffer]) const setMaxBufferText = useCallback((text: string) => setMaxBuffer(parseFloat(text)), [setMaxBuffer])
const secondsText = useCallback((value: string) => t('settings.network.values.seconds', { value }), [t])
return ( return (
<View style={styles.content}> <View style={styles.content}>
<Header>{t('settings.servers.name')}</Header> <Header>Servers</Header>
{Object.values(servers).map(s => ( {Object.values(servers).map(s => (
<ServerItem key={s.id} server={s} /> <ServerItem key={s.id} server={s} />
))} ))}
<Button <Button
style={styles.button} style={styles.button}
title={t('settings.servers.actions.add')} title="Add Server"
onPress={() => navigation.navigate('server', { title: t('settings.servers.actions.add') })} onPress={() => navigation.navigate('server')}
buttonStyle="hollow" buttonStyle="hollow"
/> />
<Header style={styles.header}>{t('settings.network.name')}</Header> <Header style={styles.header}>Network</Header>
<BitrateModal <BitrateModal title="Maximum bitrate (Wi-Fi)" bitrate={maxBitrateWifi} setBitrate={setMaxBitrateWifi} />
title={t('settings.network.options.maxBitrateWifi.title')} <BitrateModal title="Maximum bitrate (mobile)" bitrate={maxBitrateMobile} setBitrate={setMaxBitrateMobile} />
bitrate={maxBitrateWifi}
setBitrate={setMaxBitrateWifi}
/>
<BitrateModal
title={t('settings.network.options.maxBitrateMobile.title')}
bitrate={maxBitrateMobile}
setBitrate={setMaxBitrateMobile}
/>
<SettingsTextModal <SettingsTextModal
title={t('settings.network.options.minBuffer.title')} title="Minimum buffer time"
value={minBuffer.toString()} value={minBuffer.toString()}
setValue={setMinBufferText} setValue={setMinBufferText}
subtitle={secondsText} getUnit={secondsUnit}
keyboardType="numeric" keyboardType="numeric"
/> />
<SettingsTextModal <SettingsTextModal
title={t('settings.network.options.maxBuffer.title')} title="Maximum buffer time"
value={maxBuffer.toString()} value={maxBuffer.toString()}
setValue={setMaxBufferText} setValue={setMaxBufferText}
subtitle={secondsText} getUnit={secondsUnit}
keyboardType="numeric" keyboardType="numeric"
/> />
<Header style={styles.header}>{t('settings.music.name')}</Header> <Header style={styles.header}>Music</Header>
<SettingsSwitch <SettingsSwitch
title={t('settings.music.options.scrobble.title')} title="Scrobble plays"
subtitle={ subtitle={scrobble ? 'Scrobble play history' : "Don't scrobble play history"}
scrobble
? t('settings.music.options.scrobble.descriptionOn')
: t('settings.music.options.scrobble.descriptionOff')
}
value={scrobble} value={scrobble}
setValue={setScrobble} setValue={setScrobble}
/> />
<Header style={styles.header}>{t('settings.reset.name')}</Header> <Header style={styles.header}>Reset</Header>
<Button <Button
disabled={clearing} disabled={clearing}
style={styles.button} style={styles.button}
title={t('settings.reset.actions.clearImageCache')} title="Clear Image Cache"
onPress={clear} onPress={clear}
buttonStyle="hollow" buttonStyle="hollow"
/> />
<Header style={styles.header}>{t('settings.about.name')}</Header> <Header style={styles.header}>About</Header>
<Text style={styles.text}> <Text style={styles.text}>
<Text style={styles.bold}>Subtracks</Text> {t('settings.about.version', { version })} <Text style={styles.bold}>Subtracks</Text> version {version}
</Text> </Text>
<Button <Button
disabled={clearing} disabled={clearing}
style={styles.button} style={styles.button}
title={t('settings.about.actions.projectHomepage')} title="Project Homepage"
onPress={() => Linking.openURL('https://github.com/austinried/subtracks')} onPress={() => Linking.openURL('https://github.com/austinried/subtracks')}
buttonStyle="hollow" buttonStyle="hollow"
/> />
<Button <Button
disabled={clearing} disabled={clearing}
style={styles.button} style={styles.button}
title={t('settings.about.actions.licenses')} title="Licenses"
onPress={() => onPress={() => navigation.navigate('web', { uri: 'file:///android_asset/licenses.html' })}
navigation.navigate('web', {
uri: 'file:///android_asset/licenses.html',
title: t('settings.about.actions.licenses'),
})
}
buttonStyle="hollow" buttonStyle="hollow"
/> />
</View> </View>
@@ -299,10 +296,8 @@ const SettingsContent = withSuspenseMemo(() => {
}) })
const Settings = () => { const Settings = () => {
const paddingTop = useSafeAreaInsets().top
return ( return (
<GradientScrollView style={styles.scroll} contentContainerStyle={{ paddingTop }}> <GradientScrollView style={styles.scroll} contentContainerStyle={styles.scrollContentContainer}>
<SettingsContent /> <SettingsContent />
</GradientScrollView> </GradientScrollView>
) )
@@ -312,6 +307,9 @@ const styles = StyleSheet.create({
scroll: { scroll: {
flex: 1, flex: 1,
}, },
scrollContentContainer: {
paddingTop: StatusBar.currentHeight,
},
content: { content: {
paddingHorizontal: 20, paddingHorizontal: 20,
paddingBottom: 40, paddingBottom: 40,
+69 -54
View File
@@ -5,13 +5,12 @@ import ImageGradientFlatList from '@app/components/ImageGradientFlatList'
import ListItem from '@app/components/ListItem' import ListItem from '@app/components/ListItem'
import ListPlayerControls from '@app/components/ListPlayerControls' import ListPlayerControls from '@app/components/ListPlayerControls'
import NothingHere from '@app/components/NothingHere' import NothingHere from '@app/components/NothingHere'
import { useQueryAlbum, useQueryCoverArtPath, useQueryPlaylist } from '@app/hooks/query' import { useCoverArtFile } from '@app/hooks/cache'
import { useSetQueue } from '@app/hooks/trackplayer' import { Song, Album, Playlist } from '@app/models/library'
import { Album, Playlist, Song } from '@app/models/library' import { useStore, useStoreDeep } from '@app/state/store'
import colors from '@app/styles/colors' import colors from '@app/styles/colors'
import font from '@app/styles/font' import font from '@app/styles/font'
import equal from 'fast-deep-equal/es6/react' import React, { useCallback, useEffect, useState } from 'react'
import React, { useState } from 'react'
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native' import { ActivityIndicator, StyleSheet, Text, View } from 'react-native'
type SongListType = 'album' | 'playlist' type SongListType = 'album' | 'playlist'
@@ -30,7 +29,6 @@ const SongRenderItem: React.FC<{
subtitle?: string subtitle?: string
onPress?: () => void onPress?: () => void
showArt?: boolean showArt?: boolean
disabled?: boolean
} }
}> = ({ item }) => ( }> = ({ item }) => (
<ListItem <ListItem
@@ -41,7 +39,6 @@ const SongRenderItem: React.FC<{
onPress={item.onPress} onPress={item.onPress}
showArt={item.showArt} showArt={item.showArt}
style={styles.listItem} style={styles.listItem}
disabled={item.disabled}
/> />
) )
@@ -52,12 +49,19 @@ const SongListDetails = React.memo<{
songs?: Song[] songs?: Song[]
subtitle?: string subtitle?: string
}>(({ title, songList, songs, subtitle, type }) => { }>(({ title, songList, songs, subtitle, type }) => {
const { data: coverArtPath } = useQueryCoverArtPath(songList?.coverArt, 'thumbnail') const coverArtFile = useCoverArtFile(songList?.coverArt, 'thumbnail')
const [headerColor, setHeaderColor] = useState<string | undefined>(undefined) const [headerColor, setHeaderColor] = useState<string | undefined>(undefined)
const setQueue = useStore(store => store.setQueue)
if (!songList) {
return <SongListDetailsFallback />
}
const _songs = [...(songs || [])] const _songs = [...(songs || [])]
let typeName = ''
if (type === 'album') { if (type === 'album') {
typeName = 'Album'
if (_songs.some(s => s.track === undefined)) { if (_songs.some(s => s.track === undefined)) {
_songs.sort((a, b) => a.title.localeCompare(b.title)) _songs.sort((a, b) => a.title.localeCompare(b.title))
} else { } else {
@@ -67,18 +71,10 @@ const SongListDetails = React.memo<{
return aVal - bVal return aVal - bVal
}) })
} }
} else {
typeName = 'Playlist'
} }
const { setQueue, contextId } = useSetQueue(type, _songs)
if (!songList) {
return <SongListDetailsFallback />
}
const disabled = _songs.length === 0
const play = (track?: number, shuffle?: boolean) => () =>
setQueue({ title: songList.name, playTrack: track, shuffle })
return ( return (
<View style={styles.container}> <View style={styles.container}>
<HeaderBar <HeaderBar
@@ -89,17 +85,16 @@ const SongListDetails = React.memo<{
<ImageGradientFlatList <ImageGradientFlatList
data={_songs.map((s, i) => ({ data={_songs.map((s, i) => ({
song: s, song: s,
contextId, contextId: songList.id,
queueId: i, queueId: i,
subtitle: s.artist, subtitle: s.artist,
onPress: play(i), onPress: () => setQueue(_songs, songList.name, type, songList.id, i),
showArt: songList.itemType === 'playlist', showArt: songList.itemType === 'playlist',
disabled: disabled,
}))} }))}
renderItem={SongRenderItem} renderItem={SongRenderItem}
keyExtractor={(item, i) => i.toString()} keyExtractor={(item, i) => i.toString()}
backgroundProps={{ backgroundProps={{
imagePath: coverArtPath, imagePath: coverArtFile?.file?.path,
style: styles.container, style: styles.container,
onGetColor: setHeaderColor, onGetColor: setHeaderColor,
}} }}
@@ -121,67 +116,87 @@ const SongListDetails = React.memo<{
<ListPlayerControls <ListPlayerControls
style={styles.controls} style={styles.controls}
songs={_songs} songs={_songs}
listType={type} typeName={typeName}
play={play(undefined, false)} queueName={songList.name}
shuffle={play(undefined, true)} queueContextId={songList.id}
disabled={disabled} queueContextType={type}
/> />
</View> </View>
} }
/> />
</View> </View>
) )
}, equal) })
const PlaylistView = React.memo<{ const PlaylistView = React.memo<{
id: string id: string
title: string title: string
playlist?: Playlist }>(({ id, title }) => {
}>(({ id, title, playlist }) => { const playlist = useStoreDeep(useCallback(store => store.library.playlists[id], [id]))
const query = useQueryPlaylist(id, playlist) const songs = useStoreDeep(
useCallback(
store => {
const ids = store.library.playlistSongs[id]
return ids ? ids.map(i => store.library.songs[i]) : undefined
},
[id],
),
)
const fetchPlaylist = useStore(store => store.fetchPlaylist)
useEffect(() => {
if (!playlist || !songs) {
fetchPlaylist(id)
}
}, [playlist, fetchPlaylist, id, songs])
return ( return (
<SongListDetails <SongListDetails title={title} songList={playlist} songs={songs} subtitle={playlist?.comment} type="playlist" />
title={title}
songList={query.data?.playlist}
songs={query.data?.songs}
subtitle={query.data?.playlist?.comment}
type="playlist"
/>
) )
}, equal) })
const AlbumView = React.memo<{ const AlbumView = React.memo<{
id: string id: string
title: string title: string
album?: Album }>(({ id, title }) => {
}>(({ id, title, album }) => { const album = useStoreDeep(useCallback(store => store.library.albums[id], [id]))
const query = useQueryAlbum(id, album) const songs = useStoreDeep(
useCallback(
store => {
const ids = store.library.albumSongs[id]
return ids ? ids.map(i => store.library.songs[i]) : undefined
},
[id],
),
)
const fetchAlbum = useStore(store => store.fetchAlbum)
useEffect(() => {
if (!album || !songs) {
fetchAlbum(id)
}
}, [album, fetchAlbum, id, songs])
return ( return (
<SongListDetails <SongListDetails
title={title} title={title}
songList={query.data?.album} songList={album}
songs={query.data?.songs} songs={songs}
subtitle={(query.data?.album?.artist || '') + (query.data?.album?.year ? ' • ' + query.data?.album?.year : '')} subtitle={(album?.artist || '') + (album?.year ? ' • ' + album?.year : '')}
type="album" type="album"
/> />
) )
}, equal) })
const SongListView = React.memo<{ const SongListView = React.memo<{
id: string id: string
title: string title: string
type: SongListType type: SongListType
album?: Album }>(({ id, title, type }) => {
playlist?: Playlist return type === 'album' ? <AlbumView id={id} title={title} /> : <PlaylistView id={id} title={title} />
}>(({ id, title, type, album, playlist }) => { })
return type === 'album' ? (
<AlbumView id={id} title={title} album={album} />
) : (
<PlaylistView id={id} title={title} playlist={playlist} />
)
}, equal)
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
+2 -10
View File
@@ -1,17 +1,9 @@
import { useNavigation } from '@react-navigation/native' import React from 'react'
import React, { useEffect } from 'react'
import { WebView } from 'react-native-webview' import { WebView } from 'react-native-webview'
const WebViewScreen: React.FC<{ const WebViewScreen: React.FC<{
uri: string uri: string
title?: string }> = ({ uri }) => {
}> = ({ uri, title }) => {
const navigation = useNavigation()
useEffect(() => {
navigation.setOptions({ title })
}, [navigation, title])
return <WebView source={{ uri }} /> return <WebView source={{ uri }} />
} }
+259
View File
@@ -0,0 +1,259 @@
import { CacheFile, CacheImageSize, CacheItemType, CacheItemTypeKey, CacheRequest } from '@app/models/cache'
import { mkdir, rmdir } from '@app/util/fs'
import PromiseQueue from '@app/util/PromiseQueue'
import RNFS from 'react-native-fs'
import { GetStore, SetStore } from './store'
const queues: Record<CacheItemTypeKey, PromiseQueue> = {
coverArt: new PromiseQueue(5),
coverArtThumb: new PromiseQueue(50),
artistArt: new PromiseQueue(5),
artistArtThumb: new PromiseQueue(50),
song: new PromiseQueue(1),
}
export type CacheDownload = CacheFile & CacheRequest
export type CacheDirsByServer = Record<string, Record<CacheItemTypeKey, string>>
export type CacheFilesByServer = Record<string, Record<CacheItemTypeKey, Record<string, CacheFile>>>
export type CacheRequestsByServer = Record<string, Record<CacheItemTypeKey, Record<string, CacheRequest>>>
export type CacheSlice = {
cacheItem: (
key: CacheItemTypeKey,
itemId: string,
url: string | (() => string | Promise<string | undefined>),
) => Promise<void>
// cache: DownloadedItemsByServer
cacheDirs: CacheDirsByServer
cacheFiles: CacheFilesByServer
cacheRequests: CacheRequestsByServer
fetchCoverArtFilePath: (coverArt: string, size?: CacheImageSize) => Promise<string | undefined>
createCache: (serverId: string) => Promise<void>
prepareCache: (serverId: string) => void
pendingRemoval: Record<string, boolean>
removeCache: (serverId: string) => Promise<void>
clearImageCache: () => Promise<void>
}
export const createCacheSlice = (set: SetStore, get: GetStore): CacheSlice => ({
// cache: {},
cacheDirs: {},
cacheFiles: {},
cacheRequests: {},
cacheItem: async (key, itemId, url) => {
const client = get().client
if (!client) {
return
}
const activeServerId = get().settings.activeServerId
if (!activeServerId) {
return
}
if (get().pendingRemoval[activeServerId]) {
return
}
const inProgress = get().cacheRequests[activeServerId][key][itemId]
if (inProgress && inProgress.promise !== undefined) {
return await inProgress.promise
}
const existing = get().cacheFiles[activeServerId][key][itemId]
if (existing) {
return
}
const path = `${get().cacheDirs[activeServerId][key]}/${itemId}`
const promise = queues[key].enqueue(async () => {
const urlResult = typeof url === 'string' ? url : url()
const fromUrl = typeof urlResult === 'string' ? urlResult : await urlResult
try {
if (!fromUrl) {
throw new Error('cannot resolve url for cache request')
}
await RNFS.downloadFile({
fromUrl,
toFile: path,
// progressInterval: 100,
// progress: res => {
// set(
// produce<CacheSlice>(state => {
// state.cacheRequests[activeServerId][key][itemId].progress = Math.max(
// 1,
// res.bytesWritten / (res.contentLength || 1),
// )
// }),
// )
// },
}).promise
set(state => {
state.cacheRequests[activeServerId][key][itemId].progress = 1
delete state.cacheRequests[activeServerId][key][itemId].promise
})
} catch {
set(state => {
delete state.cacheFiles[activeServerId][key][itemId]
delete state.cacheRequests[activeServerId][key][itemId]
})
}
})
set(state => {
state.cacheFiles[activeServerId][key][itemId] = {
path,
date: Date.now(),
permanent: false,
}
state.cacheRequests[activeServerId][key][itemId] = {
progress: 0,
promise,
}
})
return await promise
},
fetchCoverArtFilePath: async (coverArt, size = 'thumbnail') => {
const client = get().client
if (!client) {
return
}
const activeServerId = get().settings.activeServerId
if (!activeServerId) {
return
}
const key: CacheItemTypeKey = size === 'thumbnail' ? 'coverArtThumb' : 'coverArt'
const existing = get().cacheFiles[activeServerId][key][coverArt]
const inProgress = get().cacheRequests[activeServerId][key][coverArt]
if (existing && inProgress) {
if (inProgress.promise) {
await inProgress.promise
}
return `file://${existing.path}`
}
await get().cacheItem(key, coverArt, () =>
client.getCoverArtUri({
id: coverArt,
size: size === 'thumbnail' ? '256' : undefined,
}),
)
return `file://${get().cacheFiles[activeServerId][key][coverArt].path}`
},
createCache: async serverId => {
for (const type in CacheItemType) {
await mkdir(`${RNFS.DocumentDirectoryPath}/servers/${serverId}/${type}`)
}
set(state => {
state.cacheFiles[serverId] = {
song: {},
coverArt: {},
coverArtThumb: {},
artistArt: {},
artistArtThumb: {},
}
})
get().prepareCache(serverId)
},
prepareCache: serverId => {
set(state => {
if (!state.cacheDirs[serverId]) {
state.cacheDirs[serverId] = {
song: `${RNFS.DocumentDirectoryPath}/servers/${serverId}/song`,
coverArt: `${RNFS.DocumentDirectoryPath}/servers/${serverId}/coverArt`,
coverArtThumb: `${RNFS.DocumentDirectoryPath}/servers/${serverId}/coverArtThumb`,
artistArt: `${RNFS.DocumentDirectoryPath}/servers/${serverId}/artistArt`,
artistArtThumb: `${RNFS.DocumentDirectoryPath}/servers/${serverId}/artistArtThumb`,
}
}
if (!state.cacheRequests[serverId]) {
state.cacheRequests[serverId] = {
song: {},
coverArt: {},
coverArtThumb: {},
artistArt: {},
artistArtThumb: {},
}
}
})
},
pendingRemoval: {},
removeCache: async serverId => {
set(state => {
state.pendingRemoval[serverId] = true
})
const cacheRequests = get().cacheRequests[serverId]
const pendingRequests: Promise<void>[] = []
for (const type in CacheItemType) {
const requests = Object.values(cacheRequests[type as CacheItemTypeKey])
.filter(r => r.promise !== undefined)
.map(r => r.promise) as Promise<void>[]
pendingRequests.push(...requests)
}
await Promise.all(pendingRequests)
await rmdir(`${RNFS.DocumentDirectoryPath}/servers/${serverId}`)
set(state => {
delete state.pendingRemoval[serverId]
if (state.cacheDirs[serverId]) {
delete state.cacheDirs[serverId]
}
if (state.cacheFiles[serverId]) {
delete state.cacheFiles[serverId]
}
if (state.cacheRequests[serverId]) {
delete state.cacheRequests[serverId]
}
})
},
clearImageCache: async () => {
const cacheRequests = get().cacheRequests
for (const serverId in cacheRequests) {
const coverArtRequests = cacheRequests[serverId].coverArt
const artstArtRequests = cacheRequests[serverId].artistArt
const requests = [...Object.values(coverArtRequests), ...Object.values(artstArtRequests)]
const pendingRequests = [
...(requests.filter(r => r.promise !== undefined).map(r => r.promise) as Promise<void>[]),
]
await Promise.all(pendingRequests)
await rmdir(get().cacheDirs[serverId].coverArt)
await mkdir(get().cacheDirs[serverId].coverArt)
await rmdir(get().cacheDirs[serverId].artistArt)
await mkdir(get().cacheDirs[serverId].artistArt)
set(state => {
state.cacheFiles[serverId].coverArt = {}
state.cacheFiles[serverId].coverArtThumb = {}
state.cacheFiles[serverId].artistArt = {}
state.cacheFiles[serverId].artistArtThumb = {}
})
}
},
})
+521
View File
@@ -0,0 +1,521 @@
import { Album, Artist, ArtistInfo, Playlist, SearchResults, Song } from '@app/models/library'
import { ById, OneToMany } from '@app/models/state'
import { GetStore, SetStore, Store } from '@app/state/store'
import {
AlbumID3Element,
ArtistID3Element,
ArtistInfo2Element,
ChildElement,
PlaylistElement,
} from '@app/subsonic/elements'
import { GetAlbumList2Params, Search3Params, StarParams } from '@app/subsonic/params'
import {
GetAlbumList2Response,
GetAlbumResponse,
GetArtistInfo2Response,
GetArtistResponse,
GetArtistsResponse,
GetPlaylistResponse,
GetPlaylistsResponse,
GetSongResponse,
GetTopSongsResponse,
Search3Response,
} from '@app/subsonic/responses'
import PromiseQueue from '@app/util/PromiseQueue'
import { mapId, mergeById, reduceById } from '@app/util/state'
import { WritableDraft } from 'immer/dist/types/types-external'
import pick from 'lodash.pick'
const songCoverArtQueue = new PromiseQueue(2)
export type LibrarySlice = {
library: {
artists: ById<Artist>
artistInfo: ById<ArtistInfo>
artistAlbums: OneToMany
artistNameTopSongs: OneToMany
artistOrder: string[]
albums: ById<Album>
albumSongs: OneToMany
playlists: ById<Playlist>
playlistSongs: OneToMany
songs: ById<Song>
}
resetLibrary: (state?: WritableDraft<Store>) => void
fetchArtists: () => Promise<void>
fetchArtist: (id: string) => Promise<void>
fetchArtistInfo: (artistId: string) => Promise<void>
fetchArtistTopSongs: (artistName: string) => Promise<void>
fetchAlbum: (id: string) => Promise<void>
fetchPlaylists: () => Promise<void>
fetchPlaylist: (id: string) => Promise<void>
fetchSong: (id: string) => Promise<void>
fetchAlbumList: (params: GetAlbumList2Params) => Promise<string[]>
fetchSearchResults: (params: Search3Params) => Promise<SearchResults>
star: (params: StarParams) => Promise<void>
unstar: (params: StarParams) => Promise<void>
_fixSongCoverArt: (songs: Song[]) => Promise<void>
}
const defaultLibrary = () => ({
artists: {},
artistAlbums: {},
artistInfo: {},
artistNameTopSongs: {},
artistOrder: [],
albums: {},
albumSongs: {},
playlists: {},
playlistSongs: {},
songs: {},
})
export const createLibrarySlice = (set: SetStore, get: GetStore): LibrarySlice => ({
library: defaultLibrary(),
resetLibrary: state => {
if (state) {
state.library = defaultLibrary()
return
}
set(store => {
store.library = defaultLibrary()
})
},
fetchArtists: async () => {
const client = get().client
if (!client) {
return
}
let response: GetArtistsResponse
try {
response = await client.getArtists()
} catch {
return
}
const artists = response.data.artists.map(mapArtist)
const artistsById = reduceById(artists)
const artistIds = mapId(artists)
set(state => {
state.library.artists = artistsById
state.library.artistAlbums = pick(state.library.artistAlbums, artistIds)
state.library.artistOrder = artistIds
})
},
fetchArtist: async id => {
const client = get().client
if (!client) {
return
}
let response: GetArtistResponse
try {
response = await client.getArtist({ id })
} catch {
return
}
const artist = mapArtist(response.data.artist)
const albums = response.data.albums.map(mapAlbum)
const albumsById = reduceById(albums)
set(state => {
state.library.artists[id] = artist
state.library.artistAlbums[id] = mapId(albums)
mergeById(state.library.albums, albumsById)
})
},
fetchArtistInfo: async id => {
const client = get().client
if (!client) {
return
}
let response: GetArtistInfo2Response
try {
response = await client.getArtistInfo2({ id })
} catch {
return
}
const info = mapArtistInfo(id, response.data.artistInfo)
set(state => {
state.library.artistInfo[id] = info
})
},
fetchArtistTopSongs: async artistName => {
const client = get().client
if (!client) {
return
}
let response: GetTopSongsResponse
try {
response = await client.getTopSongs({ artist: artistName, count: 50 })
} catch {
return
}
const topSongs = response.data.songs.map(mapSong)
const topSongsById = reduceById(topSongs)
get()._fixSongCoverArt(topSongs)
set(state => {
mergeById(state.library.songs, topSongsById)
state.library.artistNameTopSongs[artistName] = mapId(topSongs)
})
},
fetchAlbum: async id => {
const client = get().client
if (!client) {
return
}
let response: GetAlbumResponse
try {
response = await client.getAlbum({ id })
} catch {
return
}
const album = mapAlbum(response.data.album)
const songs = response.data.songs.map(mapSong)
const songsById = reduceById(songs)
get()._fixSongCoverArt(songs)
set(state => {
state.library.albums[id] = album
state.library.albumSongs[id] = mapId(songs)
mergeById(state.library.songs, songsById)
})
},
fetchPlaylists: async () => {
const client = get().client
if (!client) {
return
}
let response: GetPlaylistsResponse
try {
response = await client.getPlaylists()
} catch {
return
}
const playlists = response.data.playlists.map(mapPlaylist)
const playlistsById = reduceById(playlists)
set(state => {
state.library.playlists = playlistsById
state.library.playlistSongs = pick(state.library.playlistSongs, mapId(playlists))
})
},
fetchPlaylist: async id => {
const client = get().client
if (!client) {
return
}
let response: GetPlaylistResponse
try {
response = await client.getPlaylist({ id })
} catch {
return
}
const playlist = mapPlaylist(response.data.playlist)
const songs = response.data.playlist.songs.map(mapSong)
const songsById = reduceById(songs)
get()._fixSongCoverArt(songs)
set(state => {
state.library.playlists[id] = playlist
state.library.playlistSongs[id] = mapId(songs)
mergeById(state.library.songs, songsById)
})
},
fetchSong: async id => {
const client = get().client
if (!client) {
return
}
let response: GetSongResponse
try {
response = await client.getSong({ id })
} catch {
return
}
const song = mapSong(response.data.song)
get()._fixSongCoverArt([song])
set(state => {
state.library.songs[id] = song
})
},
fetchAlbumList: async params => {
const client = get().client
if (!client) {
return []
}
let response: GetAlbumList2Response
try {
response = await client.getAlbumList2(params)
} catch {
return []
}
const albums = response.data.albums.map(mapAlbum)
const albumsById = reduceById(albums)
set(state => {
mergeById(state.library.albums, albumsById)
})
return mapId(albums)
},
fetchSearchResults: async params => {
const empty = { artists: [], albums: [], songs: [] }
const client = get().client
if (!client) {
return empty
}
let response: Search3Response
try {
response = await client.search3(params)
} catch {
return empty
}
const artists = response.data.artists.map(mapArtist)
const artistsById = reduceById(artists)
const albums = response.data.albums.map(mapAlbum)
const albumsById = reduceById(albums)
const songs = response.data.songs.map(mapSong)
const songsById = reduceById(songs)
get()._fixSongCoverArt(songs)
set(state => {
mergeById(state.library.artists, artistsById)
mergeById(state.library.albums, albumsById)
mergeById(state.library.songs, songsById)
})
return {
artists: mapId(artists),
albums: mapId(albums),
songs: mapId(songs),
}
},
star: async params => {
const client = get().client
if (!client) {
return
}
let id = '-1'
let entity: 'songs' | 'artists' | 'albums' = 'songs'
if (params.id) {
id = params.id
entity = 'songs'
} else if (params.albumId) {
id = params.albumId
entity = 'albums'
} else if (params.artistId) {
id = params.artistId
entity = 'artists'
} else {
return
}
const item = get().library[entity][id]
const originalValue = item ? item.starred : null
set(state => {
state.library[entity][id].starred = new Date()
})
try {
await client.star(params)
} catch {
set(state => {
if (originalValue !== null) {
state.library[entity][id].starred = originalValue
}
})
}
},
unstar: async params => {
const client = get().client
if (!client) {
return
}
let id = '-1'
let entity: 'songs' | 'artists' | 'albums' = 'songs'
if (params.id) {
id = params.id
entity = 'songs'
} else if (params.albumId) {
id = params.albumId
entity = 'albums'
} else if (params.artistId) {
id = params.artistId
entity = 'artists'
} else {
return
}
const item = get().library[entity][id]
const originalValue = item ? item.starred : null
set(state => {
state.library[entity][id].starred = undefined
})
try {
await client.unstar(params)
} catch {
set(state => {
if (originalValue !== null) {
state.library[entity][id].starred = originalValue
}
})
}
},
// song cover art comes back from the api as a unique id per song even if it all points to the same
// album art, which prevents us from caching it once, so we need to use the album's cover art
_fixSongCoverArt: async songs => {
const client = get().client
if (!client) {
return
}
const albumsToGet: ById<Song[]> = {}
for (const song of songs) {
if (!song.albumId) {
continue
}
let album = get().library.albums[song.albumId]
if (album) {
song.coverArt = album.coverArt
continue
}
albumsToGet[song.albumId] = albumsToGet[song.albumId] || []
albumsToGet[song.albumId].push(song)
}
for (const id in albumsToGet) {
songCoverArtQueue
.enqueue(() => client.getAlbum({ id }))
.then(res => {
const album = mapAlbum(res.data.album)
set(state => {
state.library.albums[album.id] = album
for (const song of albumsToGet[album.id]) {
state.library.songs[song.id].coverArt = album.coverArt
}
})
})
}
},
})
function mapArtist(artist: ArtistID3Element): Artist {
return {
itemType: 'artist',
id: artist.id,
name: artist.name,
starred: artist.starred,
coverArt: artist.coverArt,
}
}
function mapArtistInfo(id: string, info: ArtistInfo2Element): ArtistInfo {
return {
id,
smallImageUrl: info.smallImageUrl,
largeImageUrl: info.largeImageUrl,
}
}
function mapAlbum(album: AlbumID3Element): Album {
return {
itemType: 'album',
id: album.id,
name: album.name,
artist: album.artist,
artistId: album.artistId,
starred: album.starred,
coverArt: album.coverArt,
year: album.year,
}
}
function mapPlaylist(playlist: PlaylistElement): Playlist {
return {
itemType: 'playlist',
id: playlist.id,
name: playlist.name,
comment: playlist.comment,
coverArt: playlist.coverArt,
}
}
function mapSong(song: ChildElement): Song {
return {
itemType: 'song',
id: song.id,
album: song.album,
albumId: song.albumId,
artist: song.artist,
artistId: song.artistId,
title: song.title,
track: song.track,
discNumber: song.discNumber,
duration: song.duration,
starred: song.starred,
}
}
+3 -36
View File
@@ -1,20 +1,15 @@
import { Server } from '@app/models/settings' import { Server } from '@app/models/settings'
import { ById } from '@app/models/state' import { ById } from '@app/models/state'
import { newCacheBuster } from './settings'
import RNFS from 'react-native-fs'
const migrations: Array<(state: any) => Promise<any>> = [ const migrations: Array<(state: any) => any> = [
// 1 state => {
async state => {
for (let server of state.settings.servers) { for (let server of state.settings.servers) {
server.usePlainPassword = false server.usePlainPassword = false
} }
return state return state
}, },
state => {
// 2
async state => {
state.settings.servers = state.settings.servers.reduce((acc: ById<Server>, server: Server) => { state.settings.servers = state.settings.servers.reduce((acc: ById<Server>, server: Server) => {
acc[server.id] = server acc[server.id] = server
return acc return acc
@@ -36,34 +31,6 @@ const migrations: Array<(state: any) => Promise<any>> = [
return state return state
}, },
// 3
async state => {
state.settings.cacheBuster = newCacheBuster()
state.settings.servers = Object.values(state.settings.servers as Record<string, Server>).reduce(
(acc, server, i) => {
const newId = i.toString()
if (server.id === state.settings.activeServerId) {
state.settings.activeServerId = newId
}
server.id = newId
acc[newId] = server
return acc
},
{} as Record<string, Server>,
)
try {
await RNFS.unlink(`${RNFS.DocumentDirectoryPath}/servers`)
} catch (err) {
console.error(err)
}
return state
},
] ]
export default migrations export default migrations
+16 -47
View File
@@ -1,9 +1,7 @@
import { AlbumFilterSettings, ArtistFilterSettings, ArtistFilterType, Server } from '@app/models/settings' import { AlbumFilterSettings, ArtistFilterSettings, Server } from '@app/models/settings'
import { ById } from '@app/models/state' import { ById } from '@app/models/state'
import { GetStore, SetStore } from '@app/state/store' import { GetStore, SetStore } from '@app/state/store'
import { SubsonicApiClient } from '@app/subsonic/api' import { SubsonicApiClient } from '@app/subsonic/api'
import { GetAlbumList2TypeBase } from '@app/subsonic/params'
import uuid from 'react-native-uuid'
export type SettingsSlice = { export type SettingsSlice = {
settings: { settings: {
@@ -23,19 +21,13 @@ export type SettingsSlice = {
maxBitrateMobile: number maxBitrateMobile: number
minBuffer: number minBuffer: number
maxBuffer: number maxBuffer: number
cacheBuster: string
} }
client?: SubsonicApiClient client?: SubsonicApiClient
disableMusicTabs: boolean
setDisableMusicTabs: (value: boolean) => void
changeCacheBuster: () => void
setActiveServer: (id: string | undefined, force?: boolean) => Promise<void> setActiveServer: (id: string | undefined, force?: boolean) => Promise<void>
addServer: (server: Server) => void addServer: (server: Server) => Promise<void>
removeServer: (id: string) => void removeServer: (id: string) => Promise<void>
updateServer: (server: Server) => void updateServer: (server: Server) => void
setScrobble: (scrobble: boolean) => void setScrobble: (scrobble: boolean) => void
@@ -46,12 +38,8 @@ export type SettingsSlice = {
pingServer: (server?: Server) => Promise<boolean> pingServer: (server?: Server) => Promise<boolean>
setLibraryAlbumFilterType: (type: GetAlbumList2TypeBase) => void setLibraryAlbumFilter: (filter: AlbumFilterSettings) => void
setLibraryArtistFilterType: (type: ArtistFilterType) => void setLibraryArtistFiler: (filter: ArtistFilterSettings) => void
}
export function newCacheBuster(): string {
return (uuid.v4() as string).split('-')[0]
} }
export const createSettingsSlice = (set: SetStore, get: GetStore): SettingsSlice => ({ export const createSettingsSlice = (set: SetStore, get: GetStore): SettingsSlice => ({
@@ -78,20 +66,6 @@ export const createSettingsSlice = (set: SetStore, get: GetStore): SettingsSlice
maxBitrateMobile: 192, maxBitrateMobile: 192,
minBuffer: 6, minBuffer: 6,
maxBuffer: 60, maxBuffer: 60,
cacheBuster: newCacheBuster(),
},
disableMusicTabs: false,
setDisableMusicTabs: value => {
set(store => {
store.disableMusicTabs = value
})
},
changeCacheBuster: () => {
set(store => {
store.settings.cacheBuster = newCacheBuster()
})
}, },
setActiveServer: async (id, force) => { setActiveServer: async (id, force) => {
@@ -110,24 +84,17 @@ export const createSettingsSlice = (set: SetStore, get: GetStore): SettingsSlice
return return
} }
set(state => { get().prepareCache(newActiveServer.id)
state.disableMusicTabs = true
})
set(state => { set(state => {
state.settings.activeServerId = newActiveServer.id state.settings.activeServerId = newActiveServer.id
state.client = new SubsonicApiClient(newActiveServer) state.client = new SubsonicApiClient(newActiveServer)
}) get().resetLibrary(state)
set(state => {
state.disableMusicTabs = false
}) })
}, },
addServer: server => { addServer: async server => {
const serverIds = Object.keys(get().settings.servers) await get().createCache(server.id)
server.id =
serverIds.length === 0 ? '0' : (serverIds.map(i => parseInt(i, 10)).sort((a, b) => b - a)[0] + 1).toString()
set(state => { set(state => {
state.settings.servers[server.id] = server state.settings.servers[server.id] = server
@@ -138,7 +105,9 @@ export const createSettingsSlice = (set: SetStore, get: GetStore): SettingsSlice
} }
}, },
removeServer: id => { removeServer: async id => {
await get().removeCache(id)
set(state => { set(state => {
delete state.settings.servers[id] delete state.settings.servers[id]
}) })
@@ -224,15 +193,15 @@ export const createSettingsSlice = (set: SetStore, get: GetStore): SettingsSlice
} }
}, },
setLibraryAlbumFilterType: type => { setLibraryAlbumFilter: filter => {
set(state => { set(state => {
state.settings.screens.library.albumsFilter.type = type state.settings.screens.library.albumsFilter = filter
}) })
}, },
setLibraryArtistFilterType: type => { setLibraryArtistFiler: filter => {
set(state => { set(state => {
state.settings.screens.library.artistsFilter.type = type state.settings.screens.library.artistsFilter = filter
}) })
}, },
}) })
+13 -4
View File
@@ -3,15 +3,21 @@ import AsyncStorage from '@react-native-async-storage/async-storage'
import equal from 'fast-deep-equal' import equal from 'fast-deep-equal'
import create, { GetState, Mutate, SetState, State, StateCreator, StateSelector, StoreApi } from 'zustand' import create, { GetState, Mutate, SetState, State, StateCreator, StateSelector, StoreApi } from 'zustand'
import { persist, subscribeWithSelector } from 'zustand/middleware' import { persist, subscribeWithSelector } from 'zustand/middleware'
import { CacheSlice, createCacheSlice } from './cache'
import { createLibrarySlice, LibrarySlice } from './library'
import migrations from './migrations' import migrations from './migrations'
import { createTrackPlayerSlice, TrackPlayerSlice } from './trackplayer' import { createTrackPlayerSlice, TrackPlayerSlice } from './trackplayer'
import { createTrackPlayerMapSlice, TrackPlayerMapSlice } from './trackplayermap'
import produce, { Draft } from 'immer' import produce, { Draft } from 'immer'
import { WritableDraft } from 'immer/dist/internal' import { WritableDraft } from 'immer/dist/internal'
const DB_VERSION = migrations.length const DB_VERSION = migrations.length
export type Store = SettingsSlice & export type Store = SettingsSlice &
TrackPlayerSlice & { LibrarySlice &
TrackPlayerSlice &
TrackPlayerMapSlice &
CacheSlice & {
hydrated: boolean hydrated: boolean
setHydrated: (hydrated: boolean) => void setHydrated: (hydrated: boolean) => void
} }
@@ -57,7 +63,10 @@ export const useStore = create<
persist( persist(
immer((set, get) => ({ immer((set, get) => ({
...createSettingsSlice(set, get), ...createSettingsSlice(set, get),
...createLibrarySlice(set, get),
...createTrackPlayerSlice(set, get), ...createTrackPlayerSlice(set, get),
...createTrackPlayerMapSlice(set, get),
...createCacheSlice(set, get),
hydrated: false, hydrated: false,
setHydrated: hydrated => setHydrated: hydrated =>
@@ -69,20 +78,20 @@ export const useStore = create<
name: '@appStore', name: '@appStore',
version: DB_VERSION, version: DB_VERSION,
getStorage: () => AsyncStorage, getStorage: () => AsyncStorage,
partialize: state => ({ settings: state.settings }), partialize: state => ({ settings: state.settings, cacheFiles: state.cacheFiles }),
onRehydrateStorage: _preState => { onRehydrateStorage: _preState => {
return async (postState, _error) => { return async (postState, _error) => {
await postState?.setActiveServer(postState.settings.activeServerId, true) await postState?.setActiveServer(postState.settings.activeServerId, true)
postState?.setHydrated(true) postState?.setHydrated(true)
} }
}, },
migrate: async (persistedState, version) => { migrate: (persistedState, version) => {
if (version > DB_VERSION) { if (version > DB_VERSION) {
throw new Error('cannot migrate db on a downgrade, delete all data first') throw new Error('cannot migrate db on a downgrade, delete all data first')
} }
for (let i = version; i < DB_VERSION; i++) { for (let i = version; i < DB_VERSION; i++) {
persistedState = await migrations[i](persistedState) persistedState = migrations[i](persistedState)
} }
return persistedState return persistedState
+15 -31
View File
@@ -1,22 +1,11 @@
import { NoClientError } from '@app/models/error' import { NoClientError } from '@app/models/error'
import { Song } from '@app/models/library'
import { Progress, QueueContextType, TrackExt } from '@app/models/trackplayer' import { Progress, QueueContextType, TrackExt } from '@app/models/trackplayer'
import PromiseQueue from '@app/util/PromiseQueue' import PromiseQueue from '@app/util/PromiseQueue'
import produce from 'immer' import produce from 'immer'
import TrackPlayer, { PlayerOptions, RepeatMode, State } from 'react-native-track-player' import TrackPlayer, { PlayerOptions, RepeatMode, State } from 'react-native-track-player'
import { GetStore, SetStore } from './store' import { GetStore, SetStore } from './store'
export type SetQueueOptions = {
title: string
playTrack?: number
shuffle?: boolean
}
export type SetQueueOptionsInternal = SetQueueOptions & {
queue: TrackExt[]
contextId: string
type: QueueContextType
}
export type TrackPlayerSlice = { export type TrackPlayerSlice = {
queueName?: string queueName?: string
setQueueName: (name?: string) => void setQueueName: (name?: string) => void
@@ -44,7 +33,14 @@ export type TrackPlayerSlice = {
setCurrentTrackIdx: (idx?: number) => void setCurrentTrackIdx: (idx?: number) => void
queue: TrackExt[] queue: TrackExt[]
setQueue: (options: SetQueueOptionsInternal) => Promise<void> setQueue: (
songs: Song[],
name: string,
contextType: QueueContextType,
contextId: string,
playTrack?: number,
shuffle?: boolean,
) => Promise<void>
progress: Progress progress: Progress
setProgress: (progress: Progress) => void setProgress: (progress: Progress) => void
@@ -55,7 +51,6 @@ export type TrackPlayerSlice = {
setNetState: (netState: 'mobile' | 'wifi') => Promise<void> setNetState: (netState: 'mobile' | 'wifi') => Promise<void>
rebuildQueue: (forcePlay?: boolean) => Promise<void> rebuildQueue: (forcePlay?: boolean) => Promise<void>
updateQueue: () => Promise<void>
buildStreamUri: (id: string) => string buildStreamUri: (id: string) => string
resetTrackPlayerState: () => void resetTrackPlayerState: () => void
@@ -180,17 +175,19 @@ export const createTrackPlayerSlice = (set: SetStore, get: GetStore): TrackPlaye
}), }),
queue: [], queue: [],
setQueue: async ({ queue, title, type, contextId, playTrack, shuffle }) => { setQueue: async (songs, name, contextType, contextId, playTrack, shuffle) => {
return trackPlayerCommands.enqueue(async () => { return trackPlayerCommands.enqueue(async () => {
const shuffled = shuffle !== undefined ? shuffle : !!get().shuffleOrder const shuffled = shuffle !== undefined ? shuffle : !!get().shuffleOrder
await TrackPlayer.setupPlayer(get().getPlayerOptions()) await TrackPlayer.setupPlayer(get().getPlayerOptions())
await TrackPlayer.reset() await TrackPlayer.reset()
if (queue.length === 0) { if (songs.length === 0) {
return return
} }
let queue = await get().mapSongstoTrackExts(songs)
if (shuffled) { if (shuffled) {
const { tracks, shuffleOrder } = shuffleTracks(queue, playTrack) const { tracks, shuffleOrder } = shuffleTracks(queue, playTrack)
set(state => { set(state => {
@@ -209,8 +206,8 @@ export const createTrackPlayerSlice = (set: SetStore, get: GetStore): TrackPlaye
try { try {
set(state => { set(state => {
state.queue = queue state.queue = queue
state.queueName = title state.queueName = name
state.queueContextType = type state.queueContextType = contextType
state.queueContextId = contextId state.queueContextId = contextId
}) })
get().setCurrentTrackIdx(playTrack) get().setCurrentTrackIdx(playTrack)
@@ -275,7 +272,6 @@ export const createTrackPlayerSlice = (set: SetStore, get: GetStore): TrackPlaye
const currentTrack = await getCurrentTrack() const currentTrack = await getCurrentTrack()
const playerState = await getPlayerState() const playerState = await getPlayerState()
const position = (await TrackPlayer.getPosition()) || 0 const position = (await TrackPlayer.getPosition()) || 0
const repeatMode = await getRepeatMode()
const queueName = get().queueName const queueName = get().queueName
const queueContextId = get().queueContextId const queueContextId = get().queueContextId
@@ -306,7 +302,6 @@ export const createTrackPlayerSlice = (set: SetStore, get: GetStore): TrackPlaye
await TrackPlayer.skip(currentTrack) await TrackPlayer.skip(currentTrack)
} }
await TrackPlayer.setRepeatMode(repeatMode)
await TrackPlayer.seekTo(position) await TrackPlayer.seekTo(position)
if (playerState === State.Playing || forcePlay) { if (playerState === State.Playing || forcePlay) {
@@ -315,17 +310,6 @@ export const createTrackPlayerSlice = (set: SetStore, get: GetStore): TrackPlaye
}) })
}, },
updateQueue: async () => {
const newQueue = await getQueue()
const currentTrack = await getCurrentTrack()
set(state => {
state.queue = newQueue
if (currentTrack !== undefined) {
state.currentTrack = newQueue[currentTrack]
}
})
},
buildStreamUri: id => { buildStreamUri: id => {
const client = get().client const client = get().client
if (!client) { if (!client) {
+59
View File
@@ -0,0 +1,59 @@
import { Song } from '@app/models/library'
import { TrackExt } from '@app/models/trackplayer'
import userAgent from '@app/util/userAgent'
import { GetStore, SetStore } from '@app/state/store'
export type TrackPlayerMapSlice = {
mapSongtoTrackExt: (song: Song) => Promise<TrackExt>
mapSongstoTrackExts: (songs: Song[]) => Promise<TrackExt[]>
mapTrackExtToSong: (song: TrackExt) => Song
}
export const createTrackPlayerMapSlice = (set: SetStore, get: GetStore): TrackPlayerMapSlice => ({
mapSongtoTrackExt: async song => {
let artwork = require('@res/fallback.png')
if (song.coverArt) {
const filePath = await get().fetchCoverArtFilePath(song.coverArt)
if (filePath) {
artwork = filePath
}
}
return {
id: song.id,
title: song.title,
artist: song.artist || 'Unknown Artist',
album: song.album || 'Unknown Album',
url: get().buildStreamUri(song.id),
userAgent,
artwork,
coverArt: song.coverArt,
duration: song.duration,
artistId: song.artistId,
albumId: song.albumId,
track: song.track,
discNumber: song.discNumber,
}
},
mapSongstoTrackExts: async songs => {
return await Promise.all(songs.map(get().mapSongtoTrackExt))
},
mapTrackExtToSong: track => {
return {
itemType: 'song',
id: track.id,
title: track.title as string,
artist: track.artist,
album: track.album,
streamUri: track.url as string,
coverArt: track.coverArt,
duration: track.duration,
artistId: track.artistId,
albumId: track.albumId,
track: track.track,
discNumber: track.discNumber,
}
},
})
+4
View File
@@ -1,10 +1,14 @@
import { StatusBar } from 'react-native'
const header = 56 const header = 56
const tabBar = 54 const tabBar = 54
const top = () => header + (StatusBar.currentHeight || 0)
const bottom = () => tabBar const bottom = () => tabBar
export default { export default {
header, header,
tabBar, tabBar,
top,
bottom, bottom,
} }
+10 -3
View File
@@ -101,7 +101,10 @@ export class BaseArtistInfoElement<T> {
this.largeImageUrl = e.getElementsByTagName('largeImageUrl')[0].textContent as string this.largeImageUrl = e.getElementsByTagName('largeImageUrl')[0].textContent as string
} }
this.similarArtists = Array.from(e.getElementsByTagName('similarArtist')).map(i => new artistType(i)) const similarArtistElements = e.getElementsByTagName('similarArtist')
for (let i = 0; i < similarArtistElements.length; i++) {
this.similarArtists.push(new artistType(similarArtistElements[i]))
}
} }
} }
@@ -247,7 +250,9 @@ export class PlaylistElement {
coverArt?: string coverArt?: string
constructor(e: Element) { constructor(e: Element) {
this.allowedUser = Array.from(e.getElementsByTagName('allowedUser')).map(i => i.textContent as string) for (let i = 0; i < e.getElementsByTagName('allowedUser').length; i++) {
this.allowedUser.push(e.getElementsByTagName('allowedUser')[i].textContent as string)
}
this.id = requiredString(e, 'id') this.id = requiredString(e, 'id')
this.name = requiredString(e, 'name') this.name = requiredString(e, 'name')
@@ -268,6 +273,8 @@ export class PlaylistWithSongsElement extends PlaylistElement {
constructor(e: Element) { constructor(e: Element) {
super(e) super(e)
this.songs = Array.from(e.getElementsByTagName('entry')).map(i => new ChildElement(i)) for (let i = 0; i < e.getElementsByTagName('entry').length; i++) {
this.songs.push(new ChildElement(e.getElementsByTagName('entry')[i]))
}
} }
} }
+14 -10
View File
@@ -1,15 +1,19 @@
import RNFS from 'react-native-fs' import RNFS from 'react-native-fs'
import path from 'path'
import { CacheItemTypeKey } from '@app/models/cache'
const serversCacheDir = path.join(RNFS.ExternalDirectoryPath, 's') export async function mkdir(path: string): Promise<void> {
const exists = await RNFS.exists(path)
if (exists) {
const isDir = (await RNFS.stat(path)).isDirectory()
if (!isDir) {
throw new Error(`path exists and is not a directory: ${path}`)
} else {
return
}
}
export function cacheDir(serverId?: string, itemType?: CacheItemTypeKey, itemId?: string): string { return await RNFS.mkdir(path)
const segments: string[] = [] }
serverId && segments.push(serverId) export async function rmdir(path: string): Promise<void> {
serverId && itemType && segments.push(itemType) return RNFS.unlink(path)
serverId && itemType && itemId && segments.push(itemId)
return path.join(serversCacheDir, ...segments)
} }
+3 -14
View File
@@ -1,5 +1,5 @@
import { ById, CollectionById } from '@app/models/state' import { ById } from '@app/models/state'
import _ from 'lodash' import merge from 'lodash.merge'
export function reduceById<T extends { id: string }>(collection: T[]): ById<T> { export function reduceById<T extends { id: string }>(collection: T[]): ById<T> {
return collection.reduce((acc, value) => { return collection.reduce((acc, value) => {
@@ -9,7 +9,7 @@ export function reduceById<T extends { id: string }>(collection: T[]): ById<T> {
} }
export function mergeById<T extends { [id: string]: unknown }>(object: T, source: T): void { export function mergeById<T extends { [id: string]: unknown }>(object: T, source: T): void {
_.merge(object, source) merge(object, source)
} }
export function mapById<T>(object: ById<T>, ids: string[]): T[] { export function mapById<T>(object: ById<T>, ids: string[]): T[] {
@@ -19,14 +19,3 @@ export function mapById<T>(object: ById<T>, ids: string[]): T[] {
export function mapId(entities: { id: string }[]): string[] { export function mapId(entities: { id: string }[]): string[] {
return entities.map(e => e.id) return entities.map(e => e.id)
} }
export function mapCollectionById<T, U extends { id: string }>(
collection: T[],
map: (item: T) => U,
): CollectionById<U> {
const mapped = collection.map(map)
return {
byId: reduceById(mapped),
allIds: mapId(mapped),
}
}
-2
View File
@@ -1,2 +0,0 @@
export type PromiseResolvedType<T> = T extends Promise<infer R> ? R : never
export type ReturnedPromiseResolvedType<T extends (...args: any) => any> = PromiseResolvedType<ReturnType<T>>
+1 -15
View File
@@ -1,4 +1,5 @@
import 'react-native-gesture-handler' import 'react-native-gesture-handler'
import 'react-native-get-random-values'
import { enableScreens } from 'react-native-screens' import { enableScreens } from 'react-native-screens'
enableScreens() enableScreens()
@@ -11,21 +12,6 @@ LogBox.ignoreLogs([
"[react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system!", "[react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system!",
]) ])
import i18next from 'i18next'
import { initReactI18next } from 'react-i18next'
import { backend, languageDetector } from '@app/i18n'
import * as RNLocalize from 'react-native-localize'
i18next.use(backend).use(languageDetector).use(initReactI18next).init({
compatibilityJSON: 'v3',
fallbackLng: 'en',
debug: true,
})
RNLocalize.addEventListener('change', () => {
languageDetector.detect(lng => i18next.changeLanguage(lng))
})
import { AppRegistry } from 'react-native' import { AppRegistry } from 'react-native'
import App from '@app/App' import App from '@app/App'
import { name as appName } from '@app/app.json' import { name as appName } from '@app/app.json'
-12
View File
@@ -1,12 +0,0 @@
## New
* Top Songs in the Artist view now tries to fallback to searching for songs by the artist and sorting by play count/rating if the server doesn't support the getTopSongs endpoint
* Images are now downloaded in the background via the Android DownloadManager and won't be corrupted if the app is closed
* Note: the cache file structure has been changed, so all images will be erased on update and new images will be downloaded as normal
## Fixed
* Fixed some screens displaying under the status bar on certain devices (#83)
* Fixed occasional pausing after playing a few tracks (#66)
* Fixed repeat mode not being persisted after skipping tracks (#56)
* Search no longer clears the query when going back from the "more" results screen
-10
View File
@@ -1,10 +0,0 @@
**Full Changelog**: https://github.com/austinried/subtracks/compare/v1.2.0...v1.3.0
## What's Changed
### New
* Localization support by @austinried in https://github.com/austinried/subtracks/pull/99
* 9 new languages: Catalan, Chinese (Simplified), Danish, French, German, Italian, Japanese, Norwegian Bokmål, Russian
* Thanks to @comradekingu, @clyhtsuriva, @nortio, @retiolus, @hillwah, @shoddysheep and more users from @weblate!
### Fixed
* Remove unused CHECK_LICENSE permission by @austinried in https://github.com/austinried/subtracks/pull/109
* Fix performance issue/crash with large playlists by @austinried in https://github.com/austinried/subtracks/pull/111
+13 -17
View File
@@ -1,6 +1,6 @@
{ {
"name": "subtracks", "name": "subtracks",
"version": "1.3.0", "version": "1.1.3",
"private": true, "private": true,
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"scripts": { "scripts": {
@@ -19,7 +19,7 @@
"version:major": "yarn version --major --no-git-tag-version && ./android/gradlew -p android bumpMajorVersion" "version:major": "yarn version --major --no-git-tag-version && ./android/gradlew -p android bumpMajorVersion"
}, },
"dependencies": { "dependencies": {
"@react-native-async-storage/async-storage": "1.16", "@react-native-async-storage/async-storage": "^1.15.5",
"@react-native-community/hooks": "^2.6.0", "@react-native-community/hooks": "^2.6.0",
"@react-native-community/masked-view": "^0.1.11", "@react-native-community/masked-view": "^0.1.11",
"@react-native-community/netinfo": "^6.0.0", "@react-native-community/netinfo": "^6.0.0",
@@ -29,46 +29,42 @@
"@react-navigation/native": "^5.9.4", "@react-navigation/native": "^5.9.4",
"@types/react": "^17", "@types/react": "^17",
"@xmldom/xmldom": "^0.7.0", "@xmldom/xmldom": "^0.7.0",
"content-disposition": "^0.5.4",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"i18next": "^21.6.16",
"immer": "^9.0.6", "immer": "^9.0.6",
"lodash": "^4.17.21", "lodash.debounce": "^4.0.8",
"lodash.merge": "^4.6.2",
"lodash.pick": "^4.4.0",
"md5": "^2.3.0", "md5": "^2.3.0",
"mime-types": "^2.1.35",
"path": "^0.12.7",
"react": "17.0.2", "react": "17.0.2",
"react-i18next": "^11.16.6", "react-native": "0.67.1",
"react-native": "0.67.4",
"react-native-blob-util": "https://github.com/austinried/react-native-blob-util.git#android-downloadmanager-progress",
"react-native-fs": "^2.18.0", "react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^2.3.2", "react-native-gesture-handler": "^2.3.2",
"react-native-get-random-values": "^1.7.0",
"react-native-image-colors": "^1.3.0", "react-native-image-colors": "^1.3.0",
"react-native-linear-gradient": "^2.5.6", "react-native-linear-gradient": "^2.5.6",
"react-native-localize": "^2.2.1",
"react-native-popup-menu": "^0.15.11", "react-native-popup-menu": "^0.15.11",
"react-native-reanimated": "^2.3.1", "react-native-reanimated": "^2.3.1",
"react-native-safe-area-context": "^3.2.0", "react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.4.0", "react-native-screens": "^3.4.0",
"react-native-tab-view": "^2.16.0", "react-native-tab-view": "^2.16.0",
"react-native-track-player": "https://github.com/austinried/react-native-track-player#render-extensions", "react-native-track-player": "https://github.com/austinried/react-native-track-player",
"react-native-uuid": "^2.0.1",
"react-native-vector-icons": "^8.1.0", "react-native-vector-icons": "^8.1.0",
"react-native-webview": "^11.13.0", "react-native-webview": "^11.13.0",
"react-query": "^3.34.19", "uuid": "^8.3.2",
"zustand": "^3.7.1" "zustand": "^3.7.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.12.9", "@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5", "@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0", "@react-native-community/eslint-config": "^2.0.0",
"@types/content-disposition": "^0.5.4",
"@types/jest": "^26.0.23", "@types/jest": "^26.0.23",
"@types/lodash": "^4.14.181", "@types/lodash.debounce": "^4.0.6",
"@types/lodash.merge": "^4.6.6",
"@types/lodash.pick": "^4.4.6",
"@types/md5": "^2.3.0", "@types/md5": "^2.3.0",
"@types/mime-types": "^2.1.1",
"@types/react-native-vector-icons": "^6.4.7", "@types/react-native-vector-icons": "^6.4.7",
"@types/react-test-renderer": "^16.9.2", "@types/react-test-renderer": "^16.9.2",
"@types/uuid": "^8.3.0",
"babel-jest": "^26.6.3", "babel-jest": "^26.6.3",
"babel-plugin-module-resolver": "^4.1.0", "babel-plugin-module-resolver": "^4.1.0",
"eslint": "^7.14.0", "eslint": "^7.14.0",
+67 -218
View File
@@ -719,20 +719,6 @@
dependencies: dependencies:
regenerator-runtime "^0.13.4" regenerator-runtime "^0.13.4"
"@babel/runtime@^7.14.5", "@babel/runtime@^7.17.2":
version "7.17.9"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.9.tgz#d19fbf802d01a8cb6cf053a64e472d42c434ba72"
integrity sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==
dependencies:
regenerator-runtime "^0.13.4"
"@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2":
version "7.17.8"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.8.tgz#3e56e4aff81befa55ac3ac6a0967349fd1c5bca2"
integrity sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==
dependencies:
regenerator-runtime "^0.13.4"
"@babel/template@^7.0.0", "@babel/template@^7.16.7", "@babel/template@^7.3.3": "@babel/template@^7.0.0", "@babel/template@^7.16.7", "@babel/template@^7.3.3":
version "7.16.7" version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155"
@@ -1131,10 +1117,10 @@
"@babel/runtime" "^7.7.2" "@babel/runtime" "^7.7.2"
regenerator-runtime "^0.13.3" regenerator-runtime "^0.13.3"
"@react-native-async-storage/async-storage@1.16": "@react-native-async-storage/async-storage@^1.15.5":
version "1.16.3" version "1.15.15"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.16.3.tgz#f52dc48469c3384d870d581d169e5486c2295701" resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.15.15.tgz#33f930aaebc602199a3294a9b1eafff7b56df409"
integrity sha512-yTjoTKTwI7yMi2IIlzauA7t1zoPLatEGqkvEtf4Z5p91qYp4o3M5Rdb9NiyQz7pwlTw8FqWawYPUz8nlQ2z06Q== integrity sha512-Ss2FqWP9HC5AhCyP6ydRERSwWb8QMTLknETB8cp2+tbEUhu7Q/S5+e0QIrF0D2Z/YZTUvQ2MP7uXzt9FLG9OYQ==
dependencies: dependencies:
merge-options "^3.0.4" merge-options "^3.0.4"
@@ -1445,11 +1431,6 @@
dependencies: dependencies:
"@babel/types" "^7.3.0" "@babel/types" "^7.3.0"
"@types/content-disposition@^0.5.4":
version "0.5.4"
resolved "https://registry.yarnpkg.com/@types/content-disposition/-/content-disposition-0.5.4.tgz#de48cf01c79c9f1560bcfd8ae43217ab028657f8"
integrity sha512-0mPF08jn9zYI0n0Q/Pnz7C4kThdSt+6LD4amsrYDDpgBfrVWa3TcCOxKX1zkGgYniGagRv8heN2cbh+CAn+uuQ==
"@types/eslint-visitor-keys@^1.0.0": "@types/eslint-visitor-keys@^1.0.0":
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
@@ -1504,12 +1485,28 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"
integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==
"@types/lodash@^4.14.181": "@types/lodash.debounce@^4.0.6":
version "4.14.181" version "4.0.6"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.181.tgz#d1d3740c379fda17ab175165ba04e2d03389385d" resolved "https://registry.yarnpkg.com/@types/lodash.debounce/-/lodash.debounce-4.0.6.tgz#c5a2326cd3efc46566c47e4c0aa248dc0ee57d60"
integrity sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag== integrity sha512-4WTmnnhCfDvvuLMaF3KV4Qfki93KebocUF45msxhYyjMttZDQYzHkO639ohhk8+oco2cluAFL3t5+Jn4mleylQ==
dependencies:
"@types/lodash" "*"
"@types/lodash@^4.14.53": "@types/lodash.merge@^4.6.6":
version "4.6.6"
resolved "https://registry.yarnpkg.com/@types/lodash.merge/-/lodash.merge-4.6.6.tgz#b84b403c1d31bc42d51772d1cd5557fa008cd3d6"
integrity sha512-IB90krzMf7YpfgP3u/EvZEdXVvm4e3gJbUvh5ieuI+o+XqiNEt6fCzqNRaiLlPVScLI59RxIGZMQ3+Ko/DJ8vQ==
dependencies:
"@types/lodash" "*"
"@types/lodash.pick@^4.4.6":
version "4.4.6"
resolved "https://registry.yarnpkg.com/@types/lodash.pick/-/lodash.pick-4.4.6.tgz#ae4e8f109e982786313bb6aac4b1a73aefa6e9be"
integrity sha512-u8bzA16qQ+8dY280z3aK7PoWb3fzX5ATJ0rJB6F+uqchOX2VYF02Aqa+8aYiHiHgPzQiITqCgeimlyKFy4OA6g==
dependencies:
"@types/lodash" "*"
"@types/lodash@*", "@types/lodash@^4.14.53":
version "4.14.178" version "4.14.178"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8"
integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==
@@ -1521,11 +1518,6 @@
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@types/mime-types@^2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.1.tgz#d9ba43490fa3a3df958759adf69396c3532cf2c1"
integrity sha512-vXOTGVSLR2jMw440moWTC7H19iUyLtP3Z1YTj7cSsubOICinjMxFeb/V57v9QdyyPGbbWolUFSSmSiRSn94tFw==
"@types/node@*": "@types/node@*":
version "17.0.10" version "17.0.10"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.10.tgz#616f16e9d3a2a3d618136b1be244315d95bd7cab" resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.10.tgz#616f16e9d3a2a3d618136b1be244315d95bd7cab"
@@ -1592,6 +1584,11 @@
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c"
integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==
"@types/uuid@^8.3.0":
version "8.3.4"
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc"
integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==
"@types/yargs-parser@*": "@types/yargs-parser@*":
version "20.2.1" version "20.2.1"
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129"
@@ -1927,9 +1924,9 @@ async-limiter@~1.0.0:
integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==
async@^2.4.0: async@^2.4.0:
version "2.6.4" version "2.6.3"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
dependencies: dependencies:
lodash "^4.17.14" lodash "^4.17.14"
@@ -2106,7 +2103,7 @@ balanced-match@^1.0.0:
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
base-64@0.1.0, base-64@^0.1.0: base-64@^0.1.0:
version "0.1.0" version "0.1.0"
resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb"
integrity sha1-eAqZyE59YAJgNhURxId2E78k9rs= integrity sha1-eAqZyE59YAJgNhURxId2E78k9rs=
@@ -2129,7 +2126,7 @@ base@^0.11.1:
mixin-deep "^1.2.0" mixin-deep "^1.2.0"
pascalcase "^0.1.1" pascalcase "^0.1.1"
big-integer@1.6.x, big-integer@^1.6.16: big-integer@1.6.x:
version "1.6.51" version "1.6.51"
resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686"
integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==
@@ -2184,20 +2181,6 @@ braces@^3.0.1:
dependencies: dependencies:
fill-range "^7.0.1" fill-range "^7.0.1"
broadcast-channel@^3.4.1:
version "3.7.0"
resolved "https://registry.yarnpkg.com/broadcast-channel/-/broadcast-channel-3.7.0.tgz#2dfa5c7b4289547ac3f6705f9c00af8723889937"
integrity sha512-cIAKJXAxGJceNZGTZSBzMxzyOn72cVgPnKx4dc6LRjQgbaJUQqhy5rzL3zbMxkMWsGKkv2hSFkPRMEXfoMZ2Mg==
dependencies:
"@babel/runtime" "^7.7.2"
detect-node "^2.1.0"
js-sha3 "0.8.0"
microseconds "0.2.0"
nano-time "1.0.0"
oblivious-set "1.0.0"
rimraf "3.0.2"
unload "2.2.0"
browser-process-hrtime@^1.0.0: browser-process-hrtime@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626"
@@ -2539,13 +2522,6 @@ connect@^3.6.5:
parseurl "~1.3.3" parseurl "~1.3.3"
utils-merge "1.0.1" utils-merge "1.0.1"
content-disposition@^0.5.4:
version "0.5.4"
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe"
integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==
dependencies:
safe-buffer "5.2.1"
convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0:
version "1.8.0" version "1.8.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369"
@@ -2747,11 +2723,6 @@ detect-newline@^3.0.0:
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"
integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==
detect-node@^2.0.4, detect-node@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1"
integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==
diff-sequences@^26.6.2: diff-sequences@^26.6.2:
version "26.6.2" version "26.6.2"
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1"
@@ -3214,6 +3185,11 @@ extglob@^2.0.4:
snapdragon "^0.8.1" snapdragon "^0.8.1"
to-regex "^3.0.1" to-regex "^3.0.1"
fast-base64-decode@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418"
integrity sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q==
fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
version "3.1.3" version "3.1.3"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
@@ -3621,18 +3597,11 @@ html-encoding-sniffer@^2.0.1:
dependencies: dependencies:
whatwg-encoding "^1.0.5" whatwg-encoding "^1.0.5"
html-escaper@^2.0.0, html-escaper@^2.0.2: html-escaper@^2.0.0:
version "2.0.2" version "2.0.2"
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==
html-parse-stringify@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz#dfc1017347ce9f77c8141a507f233040c59c55d2"
integrity sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==
dependencies:
void-elements "3.1.0"
http-errors@1.8.1: http-errors@1.8.1:
version "1.8.1" version "1.8.1"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c"
@@ -3666,13 +3635,6 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
i18next@^21.6.16:
version "21.6.16"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.6.16.tgz#8cff8c3ba2ffaf8438a8c83fe284083f15cf3941"
integrity sha512-xJlzrVxG9CyAGsbMP1aKuiNr1Ed2m36KiTB7hjGMG2Zo4idfw3p9THUEu+GjBwIgEZ7F11ZbCzJcfv4uyfKNuw==
dependencies:
"@babel/runtime" "^7.17.2"
iconv-lite@0.4.24: iconv-lite@0.4.24:
version "0.4.24" version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
@@ -3752,11 +3714,6 @@ inherits@2, inherits@2.0.4, inherits@~2.0.3:
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
inherits@2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
internal-slot@^1.0.3: internal-slot@^1.0.3:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c"
@@ -4509,11 +4466,6 @@ jpeg-js@0.4.2:
resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.2.tgz#8b345b1ae4abde64c2da2fe67ea216a114ac279d" resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.2.tgz#8b345b1ae4abde64c2da2fe67ea216a114ac279d"
integrity sha512-+az2gi/hvex7eLTMTlbRLOhH6P6WFdk2ITI8HJsaH2VqYO0I594zXSYEP+tf4FW+8Cy68ScDXoAsQdyQanv3sw== integrity sha512-+az2gi/hvex7eLTMTlbRLOhH6P6WFdk2ITI8HJsaH2VqYO0I594zXSYEP+tf4FW+8Cy68ScDXoAsQdyQanv3sw==
js-sha3@0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840"
integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0" version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@@ -4889,14 +4841,6 @@ map-visit@^1.0.0:
dependencies: dependencies:
object-visit "^1.0.0" object-visit "^1.0.0"
match-sorter@^6.0.2:
version "6.3.1"
resolved "https://registry.yarnpkg.com/match-sorter/-/match-sorter-6.3.1.tgz#98cc37fda756093424ddf3cbc62bfe9c75b92bda"
integrity sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw==
dependencies:
"@babel/runtime" "^7.12.5"
remove-accents "0.4.2"
md5@^2.3.0: md5@^2.3.0:
version "2.3.0" version "2.3.0"
resolved "https://registry.yarnpkg.com/md5/-/md5-2.3.0.tgz#c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f" resolved "https://registry.yarnpkg.com/md5/-/md5-2.3.0.tgz#c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f"
@@ -5256,21 +5200,11 @@ micromatch@^4.0.2:
braces "^3.0.1" braces "^3.0.1"
picomatch "^2.2.3" picomatch "^2.2.3"
microseconds@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/microseconds/-/microseconds-0.2.0.tgz#233b25f50c62a65d861f978a4a4f8ec18797dc39"
integrity sha512-n7DHHMjR1avBbSpsTBj6fmMGh2AGrifVV4e+WYc3Q9lO+xnSZ3NyhcBND3vzzatt05LFhoKFRxrIyklmLlUtyA==
mime-db@1.51.0, "mime-db@>= 1.43.0 < 2": mime-db@1.51.0, "mime-db@>= 1.43.0 < 2":
version "1.51.0" version "1.51.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c"
integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==
mime-db@1.52.0:
version "1.52.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==
mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.24: mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.24:
version "2.1.34" version "2.1.34"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24"
@@ -5278,13 +5212,6 @@ mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.24:
dependencies: dependencies:
mime-db "1.51.0" mime-db "1.51.0"
mime-types@^2.1.35:
version "2.1.35"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==
dependencies:
mime-db "1.52.0"
mime@1.6.0, mime@^1.3.4: mime@1.6.0, mime@^1.3.4:
version "1.6.0" version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
@@ -5359,13 +5286,6 @@ ms@2.1.3:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
nano-time@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/nano-time/-/nano-time-1.0.0.tgz#b0554f69ad89e22d0907f7a12b0993a5d96137ef"
integrity sha1-sFVPaa2J4i0JB/ehKwmTpdlhN+8=
dependencies:
big-integer "^1.6.16"
nanoid@^3.1.15: nanoid@^3.1.15:
version "3.2.0" version "3.2.0"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c"
@@ -5601,11 +5521,6 @@ object.values@^1.1.5:
define-properties "^1.1.3" define-properties "^1.1.3"
es-abstract "^1.19.1" es-abstract "^1.19.1"
oblivious-set@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/oblivious-set/-/oblivious-set-1.0.0.tgz#c8316f2c2fb6ff7b11b6158db3234c49f733c566"
integrity sha512-z+pI07qxo4c2CulUHCDf9lcqDlMSo72N/4rLUpRXf6fu+q8vjt8y0xS+Tlf8NTJDdTXHbdeO1n3MlbctwEoXZw==
omggif@^1.0.10, omggif@^1.0.9: omggif@^1.0.10, omggif@^1.0.9:
version "1.0.10" version "1.0.10"
resolved "https://registry.yarnpkg.com/omggif/-/omggif-1.0.10.tgz#ddaaf90d4a42f532e9e7cb3a95ecdd47f17c7b19" resolved "https://registry.yarnpkg.com/omggif/-/omggif-1.0.10.tgz#ddaaf90d4a42f532e9e7cb3a95ecdd47f17c7b19"
@@ -5831,14 +5746,6 @@ path-parse@^1.0.6, path-parse@^1.0.7:
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
path@^0.12.7:
version "0.12.7"
resolved "https://registry.yarnpkg.com/path/-/path-0.12.7.tgz#d4dc2a506c4ce2197eb481ebfcd5b36c0140b10f"
integrity sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=
dependencies:
process "^0.11.1"
util "^0.10.3"
phin@^2.9.1: phin@^2.9.1:
version "2.9.3" version "2.9.3"
resolved "https://registry.yarnpkg.com/phin/-/phin-2.9.3.tgz#f9b6ac10a035636fb65dfc576aaaa17b8743125c" resolved "https://registry.yarnpkg.com/phin/-/phin-2.9.3.tgz#f9b6ac10a035636fb65dfc576aaaa17b8743125c"
@@ -5947,7 +5854,7 @@ process-nextick-args@~2.0.0:
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
process@^0.11.1, process@^0.11.10: process@^0.11.10:
version "0.11.10" version "0.11.10"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI=
@@ -6037,15 +5944,6 @@ react-freeze@^1.0.0:
resolved "https://registry.yarnpkg.com/react-freeze/-/react-freeze-1.0.0.tgz#b21c65fe1783743007c8c9a2952b1c8879a77354" resolved "https://registry.yarnpkg.com/react-freeze/-/react-freeze-1.0.0.tgz#b21c65fe1783743007c8c9a2952b1c8879a77354"
integrity sha512-yQaiOqDmoKqks56LN9MTgY06O0qQHgV4FUrikH357DydArSZHQhl0BJFqGKIZoTqi8JizF9Dxhuk1FIZD6qCaw== integrity sha512-yQaiOqDmoKqks56LN9MTgY06O0qQHgV4FUrikH357DydArSZHQhl0BJFqGKIZoTqi8JizF9Dxhuk1FIZD6qCaw==
react-i18next@^11.16.6:
version "11.16.6"
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.16.6.tgz#e8a07802c391a55e1528673201a2727994787641"
integrity sha512-qa76GnvAPafNSxKNN/XMhdCkVN/9Lm+BpzW5+6FE2ctYUemhbglP7oklGmYiJXlG24p9itqzlJDbCi3SNd3jzA==
dependencies:
"@babel/runtime" "^7.14.5"
html-escaper "^2.0.2"
html-parse-stringify "^3.0.1"
"react-is@^16.12.0 || ^17.0.0", react-is@^17.0.1: "react-is@^16.12.0 || ^17.0.0", react-is@^17.0.1:
version "17.0.2" version "17.0.2"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
@@ -6056,13 +5954,6 @@ react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
"react-native-blob-util@https://github.com/austinried/react-native-blob-util.git#android-downloadmanager-progress":
version "0.15.0"
resolved "https://github.com/austinried/react-native-blob-util.git#aa7a1a2b9653272914d0c8ce8ee2f38428ae3948"
dependencies:
base-64 "0.1.0"
glob "^7.1.6"
react-native-codegen@^0.0.8: react-native-codegen@^0.0.8:
version "0.0.8" version "0.0.8"
resolved "https://registry.yarnpkg.com/react-native-codegen/-/react-native-codegen-0.0.8.tgz#b7796a54074139d956fff2862cf1285db43c891b" resolved "https://registry.yarnpkg.com/react-native-codegen/-/react-native-codegen-0.0.8.tgz#b7796a54074139d956fff2862cf1285db43c891b"
@@ -6073,9 +5964,9 @@ react-native-codegen@^0.0.8:
nullthrows "^1.1.1" nullthrows "^1.1.1"
react-native-fs@^2.18.0: react-native-fs@^2.18.0:
version "2.19.0" version "2.18.0"
resolved "https://registry.yarnpkg.com/react-native-fs/-/react-native-fs-2.19.0.tgz#5747eb52a5a3d2b31c8fb76f5f8044d0a855122c" resolved "https://registry.yarnpkg.com/react-native-fs/-/react-native-fs-2.18.0.tgz#987b99cc90518ef26663a8d60e62104694b41c21"
integrity sha512-Yl09IbETkV5UJcBtVtBLttyTmiAhJIHpGA/LvredI5dYiw3MXMMVu42bzELiuH2Bwj7F+qd0fMNvgfBDiDxd2A== integrity sha512-9iQhkUNnN2JNED0in06JwZy88YEVyIGKWz4KLlQYxa5Y2U0U2AZh9FUHtA04oWj+xt2LlHh0LFPCzhmNsAsUDg==
dependencies: dependencies:
base-64 "^0.1.0" base-64 "^0.1.0"
utf8 "^3.0.0" utf8 "^3.0.0"
@@ -6091,6 +5982,13 @@ react-native-gesture-handler@^2.3.2:
lodash "^4.17.21" lodash "^4.17.21"
prop-types "^15.7.2" prop-types "^15.7.2"
react-native-get-random-values@^1.7.0:
version "1.7.2"
resolved "https://registry.yarnpkg.com/react-native-get-random-values/-/react-native-get-random-values-1.7.2.tgz#60a9b6497d22e713779b71139f016a5fcec7ac04"
integrity sha512-28KRYGpIG/upV8+k/qFA+TwGW+yGjmtOHaCduJHpOQK1QUTyhiA6E2IgL4UvvU2dybeCTYFmUi9wcEQ0GiWe5g==
dependencies:
fast-base64-decode "^1.0.0"
react-native-image-colors@^1.3.0: react-native-image-colors@^1.3.0:
version "1.5.0" version "1.5.0"
resolved "https://registry.yarnpkg.com/react-native-image-colors/-/react-native-image-colors-1.5.0.tgz#42af81feb1c0654c8e4bad0d03bd9315c0b6a128" resolved "https://registry.yarnpkg.com/react-native-image-colors/-/react-native-image-colors-1.5.0.tgz#42af81feb1c0654c8e4bad0d03bd9315c0b6a128"
@@ -6108,11 +6006,6 @@ react-native-linear-gradient@^2.5.6:
resolved "https://registry.yarnpkg.com/react-native-linear-gradient/-/react-native-linear-gradient-2.5.6.tgz#96215cbc5ec7a01247a20890888aa75b834d44a0" resolved "https://registry.yarnpkg.com/react-native-linear-gradient/-/react-native-linear-gradient-2.5.6.tgz#96215cbc5ec7a01247a20890888aa75b834d44a0"
integrity sha512-HDwEaXcQIuXXCV70O+bK1rizFong3wj+5Q/jSyifKFLg0VWF95xh8XQgfzXwtq0NggL9vNjPKXa016KuFu+VFg== integrity sha512-HDwEaXcQIuXXCV70O+bK1rizFong3wj+5Q/jSyifKFLg0VWF95xh8XQgfzXwtq0NggL9vNjPKXa016KuFu+VFg==
react-native-localize@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/react-native-localize/-/react-native-localize-2.2.1.tgz#6fe646833691c6ee8a474df3c8b069402cb1dba8"
integrity sha512-BuPaQWvxLZG1NrCDGqgAnecDrNQu3LED9/Pyl4H2LwTMHcEngXpE5PfVntW2GiLumdr6nUOkWmMnh8PynZqrsw==
react-native-popup-menu@^0.15.11: react-native-popup-menu@^0.15.11:
version "0.15.12" version "0.15.12"
resolved "https://registry.yarnpkg.com/react-native-popup-menu/-/react-native-popup-menu-0.15.12.tgz#386852f4245f8d661a5003776989b9b55c9ce381" resolved "https://registry.yarnpkg.com/react-native-popup-menu/-/react-native-popup-menu-0.15.12.tgz#386852f4245f8d661a5003776989b9b55c9ce381"
@@ -6149,14 +6042,9 @@ react-native-tab-view@^2.16.0:
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-2.16.0.tgz#cae72c7084394bd328fac5fefb86cd966df37a86" resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-2.16.0.tgz#cae72c7084394bd328fac5fefb86cd966df37a86"
integrity sha512-ac2DmT7+l13wzIFqtbfXn4wwfgtPoKzWjjZyrK1t+T8sdemuUvD4zIt+UImg03fu3s3VD8Wh/fBrIdcqQyZJWg== integrity sha512-ac2DmT7+l13wzIFqtbfXn4wwfgtPoKzWjjZyrK1t+T8sdemuUvD4zIt+UImg03fu3s3VD8Wh/fBrIdcqQyZJWg==
"react-native-track-player@https://github.com/austinried/react-native-track-player#render-extensions": "react-native-track-player@https://github.com/austinried/react-native-track-player":
version "2.1.3" version "2.0.3"
resolved "https://github.com/austinried/react-native-track-player#46d2025d98b5e80ce8a3c5c3a4adee39fdd358c7" resolved "https://github.com/austinried/react-native-track-player#24cbbb4a4065ade9a38d2bcdeffa5b6a2f5c3d13"
react-native-uuid@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/react-native-uuid/-/react-native-uuid-2.0.1.tgz#ed4e2dfb1683eddb66967eb5dca140dfe1abddb9"
integrity sha512-cptnoIbL53GTCrWlb/+jrDC6tvb7ypIyzbXNJcpR3Vab0mkeaaVd5qnB3f0whXYzS+SMoSQLcUUB0gEWqkPC0g==
react-native-vector-icons@^8.1.0: react-native-vector-icons@^8.1.0:
version "8.1.0" version "8.1.0"
@@ -6180,10 +6068,10 @@ react-native-webview@^11.13.0:
escape-string-regexp "2.0.0" escape-string-regexp "2.0.0"
invariant "2.2.4" invariant "2.2.4"
react-native@0.67.4: react-native@0.67.1:
version "0.67.4" version "0.67.1"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.67.4.tgz#57a1503daa81f66a61f521ff67b259f126d87f9c" resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.67.1.tgz#a9cc13f1a691e9bb23f146f001e11fc0157af51c"
integrity sha512-NA9d9lNJu9TViEJu2uZxWXUP+QNUilGGA5tdMbVFedNroOH1lnQ3n/FAVoGK1gqGarCgNTtheBxUpEa979Cu8w== integrity sha512-doKN9qhtjilF+6p8603OVzqGKL4fq8EDAH5u00KPmZbL5ampHDQX9y8/uwlUvJggvHwZXlnvhW63u8Y1LA8rxw==
dependencies: dependencies:
"@jest/create-cache-key-function" "^27.0.1" "@jest/create-cache-key-function" "^27.0.1"
"@react-native-community/cli" "^6.0.0" "@react-native-community/cli" "^6.0.0"
@@ -6216,15 +6104,6 @@ react-native@0.67.4:
whatwg-fetch "^3.0.0" whatwg-fetch "^3.0.0"
ws "^6.1.4" ws "^6.1.4"
react-query@^3.34.19:
version "3.34.19"
resolved "https://registry.yarnpkg.com/react-query/-/react-query-3.34.19.tgz#0ff049b6e0d2ed148e9abfdd346625d0e88dc229"
integrity sha512-JO0Ymi58WKmvnhgg6bGIrYIeKb64KsKaPWo8JcGnmK2jJxAs2XmMBzlP75ZepSU7CHzcsWtIIyhMrLbX3pb/3w==
dependencies:
"@babel/runtime" "^7.5.5"
broadcast-channel "^3.4.1"
match-sorter "^6.0.2"
react-refresh@^0.4.0: react-refresh@^0.4.0:
version "0.4.3" version "0.4.3"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.3.tgz#966f1750c191672e76e16c2efa569150cc73ab53" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.3.tgz#966f1750c191672e76e16c2efa569150cc73ab53"
@@ -6372,11 +6251,6 @@ regjsparser@^0.7.0:
dependencies: dependencies:
jsesc "~0.5.0" jsesc "~0.5.0"
remove-accents@0.4.2:
version "0.4.2"
resolved "https://registry.yarnpkg.com/remove-accents/-/remove-accents-0.4.2.tgz#0a43d3aaae1e80db919e07ae254b285d9e1c7bb5"
integrity sha1-CkPTqq4egNuRngeuJUsoXZ4ce7U=
remove-trailing-separator@^1.0.1: remove-trailing-separator@^1.0.1:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
@@ -6469,13 +6343,6 @@ ret@~0.1.10:
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==
rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
dependencies:
glob "^7.1.3"
rimraf@^2.5.4: rimraf@^2.5.4:
version "2.7.1" version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
@@ -6483,6 +6350,13 @@ rimraf@^2.5.4:
dependencies: dependencies:
glob "^7.1.3" glob "^7.1.3"
rimraf@^3.0.0, rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
dependencies:
glob "^7.1.3"
rimraf@~2.2.6: rimraf@~2.2.6:
version "2.2.8" version "2.2.8"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582"
@@ -6505,11 +6379,6 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
safe-buffer@5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
safe-regex@^1.1.0: safe-regex@^1.1.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
@@ -7299,14 +7168,6 @@ universalify@^0.1.0, universalify@^0.1.2:
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
unload@2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/unload/-/unload-2.2.0.tgz#ccc88fdcad345faa06a92039ec0f80b488880ef7"
integrity sha512-B60uB5TNBLtN6/LsgAf3udH9saB5p7gqJwcFfbOEZ8BcBHnGwCf6G/TGiEqkRAxX7zAFIUtzdrXQSdL3Q/wqNA==
dependencies:
"@babel/runtime" "^7.6.2"
detect-node "^2.0.4"
unpipe@~1.0.0: unpipe@~1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
@@ -7374,13 +7235,6 @@ util-deprecate@~1.0.1:
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
util@^0.10.3:
version "0.10.4"
resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901"
integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==
dependencies:
inherits "2.0.3"
utils-merge@1.0.1: utils-merge@1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
@@ -7391,7 +7245,7 @@ uuid@^3.3.2:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
uuid@^8.3.0: uuid@^8.3.0, uuid@^8.3.2:
version "8.3.2" version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
@@ -7428,11 +7282,6 @@ vlq@^1.0.0:
resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468" resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468"
integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w== integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==
void-elements@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09"
integrity sha1-YU9/v42AHwu18GYfWy9XhXUOTwk=
w3c-hr-time@^1.0.2: w3c-hr-time@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"