Compare commits

..

112 commits

Author SHA1 Message Date
firelight
a72f9e6c3f
Translated using Weblate (Albanian) (#3102)
Currently translated at 100.0% (4 of 4 strings)

Translated using Weblate (Albanian)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Ukrainian)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Tamil)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Turkish)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Italian)

Currently translated at 100.0% (735 of 735 strings)

Update translation files

Updated by "Remove blank strings" hook in Weblate.

Translated using Weblate (Spanish)

Currently translated at 99.7% (733 of 735 strings)

Translated using Weblate (Vietnamese)

Currently translated at 99.8% (734 of 735 strings)

Translated using Weblate (Swedish)

Currently translated at 99.8% (734 of 735 strings)

Translated using Weblate (Polish)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Arabic)

Currently translated at 99.7% (733 of 735 strings)

Translated using Weblate (English)

Currently translated at 99.8% (734 of 735 strings)

Translated using Weblate (Ukrainian)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Turkish)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Polish)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Czech)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Italian)

Currently translated at 100.0% (733 of 733 strings)

Translated using Weblate (Czech)

Currently translated at 100.0% (733 of 733 strings)













Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/ar/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/cs/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/en/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/es/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/it/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/pl/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/sq/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/sv/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/ta/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/tr/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/uk/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/vi/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/fastlane/sq/
Translation: Cloudstream/App
Translation: Cloudstream/Fastlane

Co-authored-by: 007 <juri.malaj@gmail.com>
Co-authored-by: Aziz Hadidi <azizhadidi@proton.me>
Co-authored-by: Dan <jonweblin2205@protonmail.com>
Co-authored-by: Fjuro <fjuro@users.noreply.hosted.weblate.org>
Co-authored-by: Hosted Weblate user 54392 <hamburger2048@users.noreply.hosted.weblate.org>
Co-authored-by: Man <thebroker2308@gmail.com>
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
Co-authored-by: Matthaiks <kitynska@gmail.com>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: win7guru <winsevn@users.noreply.hosted.weblate.org>
Co-authored-by: தமிழ்நேரம் <tamilneram247@gmail.com>
2026-08-05 22:54:24 +00:00
Hosted Weblate
5a67740643
Merge remote-tracking branch 'origin/master' 2026-08-06 00:54:04 +02:00
Bnyro
2207215a82
feat(extractors): add playmate extractor (#3103) 2026-08-05 22:53:51 +00:00
Hosted Weblate
9d070417ed
Translated using Weblate (Albanian)
Currently translated at 100.0% (4 of 4 strings)

Translated using Weblate (Albanian)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Ukrainian)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Tamil)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Turkish)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Italian)

Currently translated at 100.0% (735 of 735 strings)

Update translation files

Updated by "Remove blank strings" hook in Weblate.

Translated using Weblate (Spanish)

Currently translated at 99.7% (733 of 735 strings)

Translated using Weblate (Vietnamese)

Currently translated at 99.8% (734 of 735 strings)

Translated using Weblate (Swedish)

Currently translated at 99.8% (734 of 735 strings)

Translated using Weblate (Polish)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Arabic)

Currently translated at 99.7% (733 of 735 strings)

Translated using Weblate (English)

Currently translated at 99.8% (734 of 735 strings)

Translated using Weblate (Ukrainian)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Turkish)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Polish)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Czech)

Currently translated at 100.0% (735 of 735 strings)

Translated using Weblate (Italian)

Currently translated at 100.0% (733 of 733 strings)

Translated using Weblate (Czech)

Currently translated at 100.0% (733 of 733 strings)

Co-authored-by: 007 <juri.malaj@gmail.com>
Co-authored-by: Aziz Hadidi <azizhadidi@proton.me>
Co-authored-by: Dan <jonweblin2205@protonmail.com>
Co-authored-by: Fjuro <fjuro@users.noreply.hosted.weblate.org>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Hosted Weblate user 54392 <hamburger2048@users.noreply.hosted.weblate.org>
Co-authored-by: Man <thebroker2308@gmail.com>
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
Co-authored-by: Matthaiks <kitynska@gmail.com>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: win7guru <winsevn@users.noreply.hosted.weblate.org>
Co-authored-by: தமிழ்நேரம் <tamilneram247@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/ar/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/cs/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/en/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/es/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/it/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/pl/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/sq/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/sv/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/ta/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/tr/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/uk/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/vi/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/fastlane/sq/
Translation: Cloudstream/App
Translation: Cloudstream/Fastlane
2026-08-05 22:53:21 +00:00
Bnyro
65269fb3b1
feat(extractors): add vidara mirrors and fix links with filecodes (#3104) [skip ci] 2026-08-05 22:52:36 +00:00
Jelle Thijs
caf0db3dc1
Feat: Add optional clock to TV player 2026-08-01 01:14:02 +00:00
firelight
1cf7425093
Merge pull request #3067 from recloudstream/weblate
Translations update from Hosted Weblate
2026-07-31 17:06:42 +00:00
Hosted Weblate
d7a9675bd3
Merge remote-tracking branch 'origin/master' 2026-07-31 17:00:23 +00:00
Hosted Weblate
e80fa1b30d
Translated using Weblate (Albanian)
Currently translated at 100.0% (733 of 733 strings)

Translated using Weblate (Polish)

Currently translated at 100.0% (733 of 733 strings)

Translated using Weblate (Bengali)

Currently translated at 52.6% (384 of 729 strings)

Translated using Weblate (English)

Currently translated at 100.0% (729 of 729 strings)

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Update translation files

Updated by "Remove blank strings" hook in Weblate.

Translated using Weblate (Bengali)

Currently translated at 51.0% (372 of 729 strings)

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Translated using Weblate (Dutch)

Currently translated at 92.4% (674 of 729 strings)

Translated using Weblate (Vietnamese)

Currently translated at 100.0% (729 of 729 strings)

Translated using Weblate (Vietnamese)

Currently translated at 100.0% (729 of 729 strings)

Translated using Weblate (Bengali)

Currently translated at 75.0% (3 of 4 strings)

Translated using Weblate (Bengali)

Currently translated at 49.9% (364 of 729 strings)

Co-authored-by: 007 <juri.malaj@gmail.com>
Co-authored-by: Aishik Mukherjee <aishikm2002@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Man <thebroker2308@gmail.com>
Co-authored-by: Matthaiks <kitynska@gmail.com>
Co-authored-by: caviaz <sverrebesteman@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/bn/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/en/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/nl/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/pl/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/sq/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/vi/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/fastlane/bn/
Translation: Cloudstream/App
Translation: Cloudstream/Fastlane
2026-07-31 17:00:10 +00:00
recloudstream[bot]
7f750964f3 chore(locales): fix locale issues 2026-07-31 17:00:05 +00:00
firelight
ff701cb220
Add Belarusian, Catalan and Albanian 2026-07-31 16:59:46 +00:00
firelight
a2adb6caaa
[skip ci] Swallow exception when device does not support channels 2026-07-31 15:35:02 +00:00
CranberrySoup
f09435dc18
Add source hiding (#2570) 2026-07-31 15:25:00 +00:00
Luna712
2eb05e8f35
DataStore: deprecate toKotlinObject (#2964)
1. It can sometimes cause type erasure
2. It is less clear what it is doing
3. It is easy to replace
4. It is very rarely used, almost all app usage has already been replaced, and I haven't found any extensions actually using it but still following normal deprecation cycle as some still might be using it.
2026-07-31 15:01:45 +00:00
firelight
1e33e42277
fix subtitle clipping (#3099) 2026-07-31 14:59:31 +00:00
Kraptor123
93d3b36575
feat: add settings button to provider selection in home (#3060) 2026-07-25 22:43:11 +00:00
danzybae
2cd65aad4f
Fix posterHeaders not passed in TV detail menu (#3088) 2026-07-25 19:53:45 +00:00
danzybae
115be075d4
Fix posterHeaders not passed in home preview carousel (#3085) 2026-07-19 18:30:04 +00:00
Luna712
e48c97363e
[skip ci] Add actual declarations for webMain/webTest (#3072) 2026-07-15 22:27:22 +00:00
Luna712
6ca7507146
HlsPlaylistParser: replace usage of Java APIs with kotlin equivalents (#2828)
This does add kotlinx-io as a dependency, it is more light weight then okio, and when we migrate to ktor for example it will become an implicit dependency anyway so it should be fine to just add. Allows for more reliable and readable usage then doing some of this manually.
2026-07-15 13:34:43 +00:00
Luna712
91e533686e
[skip ci] Rewrite TmdbProvider to remove external lib dependency (#2800) 2026-07-15 13:31:41 +00:00
Luna712
fef17079a8
[skip ci] Coroutines KMP API (#2836) 2026-07-15 13:05:44 +00:00
firelight
fb8bcb4ac7
more robust date parsing (#3068) 2026-07-14 17:23:52 +00:00
Leandre Chamberland-Dozois
c09c06820d
fix(download): remove deleted/cancelled items from the Downloads list in real time (#1227) (#2598) 2026-07-14 15:19:39 +00:00
Kraptor123
3650221334
[skip ci] ui: Hide pinned NSFW-only extensions from non-NSFW categories (#2923) 2026-07-14 15:05:15 +00:00
firelight
c66b0eadd6
Fix failed cast in ContextHelper 2026-07-14 13:29:29 +00:00
Luna712
804b3c279c
extractors: migrate to kotlinx serialization (#2963) 2026-07-14 13:04:51 +00:00
Luna712
feddcccf0d
[skip ci] Update Kotlin to 2.4.0 (#2868) 2026-07-14 12:17:47 +00:00
Luna712
15fea0c7ca
Bump compilesdk to 37 (#2670) 2026-07-13 18:37:33 +00:00
Luna712
d778befe19
[skip ci] Add KMP locale API for SubtitleHelper (#2833) 2026-07-13 18:26:21 +00:00
Luna712
076e7a5116
[skip ci] test: add an IgnoreOnWeb annotation (#3034) 2026-07-13 18:00:32 +00:00
firelight
ecf5650bbd
fix build 2026-07-13 14:46:09 +00:00
Phisher98
b245a2d9d7
Fix VidHidePro M3U8 type detection in JWPlayerHelper (#3064) 2026-07-13 14:28:26 +00:00
Luna712
b1ce67dbf3
ControllerActivity: migrate to kotlinx serialization (#2958) 2026-07-13 13:20:02 +00:00
Luna712
eef67fa699
Replace usage of gson in extractors (#2983) 2026-07-13 13:14:51 +00:00
Luna712
86d713c33c
[skip ci] Improve ContextHelper API for KMP (#2834) 2026-07-13 12:57:43 +00:00
firelight
45a795f25f
[skip ci] Translated using Weblate (Latvian) (#2943)
Co-authored-by: Aishik Mukherjee <aishikm2002@gmail.com>
Co-authored-by: Kie Takaba <takabakie@gmail.com>
Co-authored-by: Man <thebroker2308@gmail.com>
Co-authored-by: Nori Masomi (Mystical) <mysticalkeyall@users.noreply.hosted.weblate.org>
Co-authored-by: Saleh ALHarbi <alfraidigamerofficial@gmail.com>
Co-authored-by: caviaz <sverrebesteman@gmail.com>
Co-authored-by: gabix <gabi1xperson@gmail.com>
Co-authored-by: hou1234 <gjqmgjsl3@gmail.com>
Co-authored-by: trodiz <neptune32@protonmail.com>
Co-authored-by: ℂ𝕠𝕠𝕠𝕝 (𝕘𝕚𝕥𝕙𝕦𝕓.𝕔𝕠𝕞/ℂ𝕠𝕠𝕠𝕝) <coool@mail.lv>
2026-07-13 12:48:43 +00:00
Hosted Weblate
e2d49567b6
Merge remote-tracking branch 'origin/master' 2026-07-13 14:42:20 +02:00
Luna712
105f168b2d
[skip ci] Add new splitUrlParameters API accepting Ktor Url or string (#2931) 2026-07-13 12:42:15 +00:00
Hosted Weblate
0859285e43
Merge remote-tracking branch 'origin/master' 2026-07-13 12:40:54 +00:00
Luna712
2a75b8cb08
[skip ci] Mark UriSerializer InternalAPI (#3062)
We shouldn't really be encouraging extensions to use it and use ktor Url instead which has a serializer for it built into ktor. Eventually I think we should factor out the two usages of an actual Uri in serialization and remove this serializer.
2026-07-13 12:40:47 +00:00
Hosted Weblate
737135fcb7
Merge remote-tracking branch 'origin/master' 2026-07-13 00:38:24 +02:00
Luna712
7b3c938ba7
Add more custom serializers for kotlinx serialization (#2978)
This adds numerous other serializers to replicate Jackson mapper configuration behavior, that some extensions will need.
2026-07-12 22:38:08 +00:00
Hosted Weblate
07dbc848ee
Merge remote-tracking branch 'origin/master' 2026-07-13 00:18:32 +02:00
Luna712
15632b864a
[skip ci] TraktProvider: migrate to kotlinx serialization (#2872) 2026-07-12 22:18:22 +00:00
Hosted Weblate
8f1317c82c
Merge remote-tracking branch 'origin/master' 2026-07-13 00:09:48 +02:00
Luna712
505722c1b5
[skip ci] Torrent: migrate to kotlinx serialization (#2882) 2026-07-12 22:09:36 +00:00
Hosted Weblate
024d2a5c7f
Merge remote-tracking branch 'origin/master' 2026-07-12 23:44:05 +02:00
firelight
70469f55db
[skip ci] Migration guide (#3058) 2026-07-12 21:43:59 +00:00
Hosted Weblate
9f64b6da29
Merge remote-tracking branch 'origin/master' 2026-07-11 19:21:51 +00:00
Hosted Weblate
c265d630ac
Translated using Weblate (Latvian)
Currently translated at 81.4% (594 of 729 strings)

Translated using Weblate (Bengali)

Currently translated at 48.1% (351 of 729 strings)

Translated using Weblate (Lithuanian)

Currently translated at 35.6% (260 of 729 strings)

Translated using Weblate (Dutch)

Currently translated at 91.0% (664 of 729 strings)

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Translated using Weblate (Arabic (Saudi Arabia))

Currently translated at 100.0% (4 of 4 strings)

Translated using Weblate (Japanese)

Currently translated at 100.0% (729 of 729 strings)

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Translated using Weblate (Vietnamese)

Currently translated at 100.0% (729 of 729 strings)

Translated using Weblate (Malayalam)

Currently translated at 37.8% (276 of 729 strings)

Translated using Weblate (Japanese)

Currently translated at 99.5% (726 of 729 strings)

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Merge remote-tracking branch 'origin/master'

Translated using Weblate (Korean)

Currently translated at 100.0% (729 of 729 strings)

Co-authored-by: Aishik Mukherjee <aishikm2002@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Kie Takaba <takabakie@gmail.com>
Co-authored-by: Man <thebroker2308@gmail.com>
Co-authored-by: Nori Masomi (Mystical) <mysticalkeyall@users.noreply.hosted.weblate.org>
Co-authored-by: Saleh ALHarbi <alfraidigamerofficial@gmail.com>
Co-authored-by: caviaz <sverrebesteman@gmail.com>
Co-authored-by: gabix <gabi1xperson@gmail.com>
Co-authored-by: hou1234 <gjqmgjsl3@gmail.com>
Co-authored-by: trodiz <neptune32@protonmail.com>
Co-authored-by: ℂ𝕠𝕠𝕠𝕝 (𝕘𝕚𝕥𝕙𝕦𝕓.𝕔𝕠𝕞/ℂ𝕠𝕠𝕠𝕝) <coool@mail.lv>
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/bn/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/ja/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/ko/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/lt/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/lv/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/ml/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/nl/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/app/vi/
Translate-URL: https://hosted.weblate.org/projects/cloudstream/fastlane/ar_SA/
Translation: Cloudstream/App
Translation: Cloudstream/Fastlane
2026-07-11 21:21:44 +02:00
Luna712
11792dd65c
Add type for tryParseJson (#3057) 2026-07-11 21:21:42 +02:00
Luna712
4a79ca1c9f
Add missing types to getKey calls (#3056) 2026-07-11 21:21:11 +02:00
BlipBlob
3496e5f8d2
[skip ci] Use abiValidation to prevent breaking changes in extension library (#2835) 2026-07-10 22:59:31 +00:00
Luna712
5cd1cb3433
SimklApi: migrate to kotlinx serialization (#2998) 2026-07-10 18:26:09 +00:00
Luna712
f03b18ff95
[skip ci] Enable some deprecations (#3048) 2026-07-10 18:19:33 +00:00
Luna712
0af9b7f569
DataStoreHelper: migrate to kotlinx serialization (#3027) 2026-07-10 16:59:59 +00:00
firelight
1463cf40cd
remove prerelease annotations (#3046) 2026-07-10 16:57:27 +00:00
Luna712
3e17b3a5a0
Make some private cryptography methods suspend (#3040) 2026-07-10 16:55:35 +00:00
Luna712
8c3dbdc5b6
Remove fuzzywuzzy from library (#2999)
It doesn't use api(), which means extensions don't inherently have access, and they must already have the dependency explicit to use it. It being in app prevents runtime errors if they use it, but it being an implimentation in the library should be completely unused and unnecessary.
2026-07-10 16:54:15 +00:00
Luna712
5b0c5afeba
EmturbovidExtractor: replace selectXpath (#2977)
This will be necessary when we finally fully migrate to ksoup, which currently doesn't have selectXpath, but for our usages that is not necessary. This way is also more consistent with how we do it everywhere else.
2026-07-10 16:53:36 +00:00
Kraptor123
e75b5e64a7
shortcode: Add py.md as alternative to cutt.ly (#3001) 2026-07-10 16:52:23 +00:00
Luna712
c36652d265
[skip ci] DownloadObjects: migrate to kotlinx serialization (#3026) 2026-07-10 16:40:25 +00:00
Luna712
b681d443e4
[skip ci] Make some classes serializable (#2874) 2026-07-10 16:18:30 +00:00
Luna712
189162fac9
AesHelper: make the new cryptoAESHandler suspend (#3039) 2026-07-10 16:12:06 +00:00
Osten
3796406e63
Bump to 4.8.0 2026-07-10 01:46:50 +02:00
Luna712
8bdc599996
test: some cleanup to JsInterpreterTest (#3036) 2026-07-09 17:43:49 +00:00
Luna712
0e3191e28b
[skip ci] Update commented deprecation message for getRhinoContext (#3037) 2026-07-09 17:41:14 +00:00
Luna712
11202d269d
[skip ci] SyncUtil: fix type for tryParseJson (#3038) 2026-07-09 17:40:00 +00:00
firelight
07b4d2d576
Remove AM/PM when on 24h settings 2026-07-09 15:51:16 +00:00
firelight
66afc3b1ee
Feat: Animation to actor adapter (#3035) 2026-07-09 15:50:05 +00:00
firelight
e428d422eb
Fix: Remove uiReset for better UX for errors (#3023) 2026-07-09 11:12:37 +00:00
firelight
59eaed0c82
Fix: Subsouce and cache issue (#3033) 2026-07-09 11:08:53 +00:00
Luna712
694c9c4413
Add JsInterpreter to replace Rhino usage (#2812) 2026-07-09 01:41:54 +02:00
firelight
480d48bea4
Fix: Switch focus on skip chapter (#3024) 2026-07-09 01:26:42 +02:00
firelight
a123c5935c
Fix slow startup in downloader 2026-07-08 17:30:23 +00:00
firelight
5cb939df69
Fix: Corrupted HSL files due to 404 (#3013) 2026-07-08 17:29:06 +00:00
firelight
60cfeba735
Fix: Sync delay, Progress on sync button and runOnMainThreadNative fix (#3032) 2026-07-08 17:13:50 +00:00
Luna712
678726e9ee
GogoHelper: use more clear name for private method (#3028) 2026-07-08 16:17:17 +02:00
firelight
894a18a831
Feat: Loading apply button (#3025) 2026-07-07 18:34:00 +00:00
firelight
5bae7d35d8
Fix: Subtitle ordering on names (#3012) 2026-07-07 14:17:39 +00:00
firelight
94ce0d4385
Fix: Repo dismiss (#3020) 2026-07-07 14:09:34 +00:00
firelight
55b5017068
[skip ci] Fix: Sync episode setting, Closes #3014 (#3021) 2026-07-07 14:06:47 +00:00
firelight
e8c005dfeb
[skip ci] Fix: Leading space in Vids (#3022) 2026-07-07 14:05:07 +00:00
Luna712
bfb85ca5c9
[skip ci] SerializationClassTester: skip abstract classes (#2960)
Necessary for some such as LibrarySearchResponse and DownloadCached. Using the skip annotation causes it to also skip child classes which we don't want so just skip abstract classes since Instancio can't create an instance of an abstract class: "It is an abstract class and no subtype was provided".
2026-07-06 20:17:29 +00:00
Bnyro
8828ee1718
feat(extractors): add vids.st extractor (#3008) 2026-07-06 20:05:23 +00:00
Bnyro
5bcac072e1
fix(extractors) fix gupload extractor (#3007) 2026-07-06 20:04:38 +00:00
danzybae
771a201d76
Fix regex to match quality case insensitively (#3002) 2026-07-06 18:24:48 +00:00
Bnyro
2cde74de27
feat(extractors): fix vidara and update list of mirrors (#2992) 2026-07-03 18:47:31 +00:00
Bnyro
adb57c86b3
feat(extractors): add firestream.to extractor (#2993) 2026-07-03 18:43:40 +00:00
Bnyro
bc270d538c
feat(extractors): add streamcash.to extractor (#2994) 2026-07-03 18:41:43 +00:00
Luna712
fd078d75be
[skip ci] Add expect/actual for WorkerThread (#2997)
This will later be necessary for other targets as it only exists on JVM platforms. Other targets would just define it as a base annoation that doesn't do anything, allows us to keep thread safety on JVM platforms but still be able to compile for others that don't have it.
2026-07-03 18:31:18 +00:00
Luna712
4b6bfa8bbd
Promote AcraApplication deprecations to error level (#2630) 2026-07-02 23:48:49 +00:00
firelight
b5e2a0eff4
Update user agent
Fixes #2951
2026-07-02 23:43:39 +00:00
Luna712
5e85c80fd5
Replace some JVM specific stuff in JsHunter and JsUnpacker (#2990) 2026-07-02 22:14:40 +00:00
Luna712
982189cdf0
AniListApi: migrate to kotlinx serialization (#2952) 2026-07-02 22:12:28 +00:00
Luna712
faacc1a893
[skip ci] Remove failOnNoDiscoveredTests = false (#2985)
Not needed anymore since we actually have tests now.
2026-07-02 21:43:53 +00:00
Luna712
d164c36123
[skip ci] Remove completely commented and out of date ProviderTests file (#2973) 2026-07-02 21:42:32 +00:00
Luna712
b1022805bb
Add kotlin-reflect to jvmCommonMain in library (#2989) 2026-07-02 21:41:12 +00:00
Luna712
60da132d3f
[skip ci] MyDramaList: migrate to kotlinx serialization (#2870) 2026-07-02 21:40:57 +00:00
Luna712
aaa87c1ccc
LibraryFragment: migrate to kotlinx serialization (#2972) 2026-07-02 21:31:41 +00:00
Luna712
56c6400fd9
[skip ci] Remove unnecessary ?. (#2982)
It is a build warning
2026-07-02 21:27:46 +00:00
Luna712
971027d2d1
[skip ci] Add JvmName import to MainAPI (#2988)
Necessary for non JVM platforms or it won't resolve. On non JVM platforms the annotation is simply erased at compile time but still compiled as long as the import is present.
2026-07-02 21:26:54 +00:00
KingLucius
870d514bb7
Focus "Add Repo" by Right click on Extensions page (#2986) 2026-07-02 15:29:35 +00:00
firelight
b425d39ef5
Fix(TV): Crash issue due to missing xml, Closes #2980 (#2981) 2026-06-30 20:40:58 +02:00
Luna712
9ab4150c4f
[skip ci] Support running instrumented tests with a comment in pull requests (#2792) 2026-06-30 17:31:05 +00:00
Luna712
6a7a31cefb
Replace javaClass with Kotlin ::class for consistency (#2976)
I used Jackson's JsonAlias and Kotlinx Serialization's JsonNames annotations for CustomSite to maintain backwards compatibility for deserialization but future serialization would use the new name, so `parentClassName` rather than `parentJavaClass`.
2026-06-30 17:16:04 +00:00
Luna712
959970cfd1
fcast: migrate to kotlinx serialization (#2970) 2026-06-30 18:40:37 +02:00
Luna712
53b0150245
Remove broken providersExist test (#2974) 2026-06-30 18:39:14 +02:00
Luna712
a074b96d48
VotingApi: add missing type (#2971) 2026-06-30 18:38:15 +02:00
firelight
609834cf03
refactor plugin logic and add repository name (#2975) 2026-06-30 18:37:38 +02:00
firelight
f1578919b6
Add button to search extensions (#2966) 2026-06-27 14:11:10 +00:00
210 changed files with 19266 additions and 3709 deletions

105
.github/workflows/instrumented-tests.yml vendored Normal file
View file

@ -0,0 +1,105 @@
name: Instrumented Tests
on:
issue_comment:
types: [created]
permissions:
contents: read
pull-requests: write
jobs:
instrumented-tests:
runs-on: ubuntu-latest
if: |
github.event.issue.pull_request &&
github.event.comment.body == '/run-tests'
steps:
- name: Check permission
uses: actions/github-script@v9
with:
script: |
const login = context.payload.comment.user.login;
const association = context.payload.comment.author_association;
const allowed = ['OWNER', 'MEMBER'];
const isAllowed =
login === 'Luna712' ||
allowed.includes(association);
if (!isAllowed) {
core.setFailed(`User ${login} is not permitted to trigger this workflow.`);
}
- uses: actions/checkout@v6
with:
ref: refs/pull/${{ github.event.issue.number }}/head
- name: Post started comment
uses: actions/github-script@v9
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Instrumented tests are running. [View live progress](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})'
})
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
cache-read-only: false
- name: Get target SDK
id: sdk
run: |
TARGET_SDK=$(grep 'targetSdk' gradle/libs.versions.toml | grep -o '[0-9]\+' | head -1)
echo "version=$TARGET_SDK" >> $GITHUB_OUTPUT
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run Instrumented Tests
id: tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ steps.sdk.outputs.version }}
arch: x86_64
profile: Nexus 6
script: ./gradlew connectedPrereleaseDebugAndroidTest
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: instrumented-test-results
path: '**/build/reports/androidTests/'
- name: Post finished comment
if: always()
uses: actions/github-script@v9
with:
script: |
const success = '${{ steps.tests.outcome }}' === 'success';
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: success
? 'Instrumented tests passed. [View results](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})'
: 'Instrumented tests failed. [View results](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})'
})

View file

@ -26,6 +26,11 @@ jobs:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
cache-read-only: false cache-read-only: false
- name: Ensure binary compatibility
# This is to ensure that your code is backwards compatible.
# If this fails you need to add a @Prerelease annotation to new code.
run: ./gradlew library:checkKotlinAbi
- name: Run Gradle - name: Run Gradle
run: ./gradlew assemblePrereleaseDebug lint check run: ./gradlew assemblePrereleaseDebug lint check

21
COMPOSE.md Normal file
View file

@ -0,0 +1,21 @@
# Migration guide to Compose
### 1. MVI instead of MVVM
The current design of CloudStream loosely uses the MVVM architecture.
This means that the UI invokes the viewmodel with function calls, and it responds with LiveData fields that are observed. While this has worked, it generates a lot of boilerplate and has created some friction.
To make it easier to work with Compose, the new architecture will be based on MVI. In short this means that the viewmodel exposes a singular immutable class that is observed, and receives all UI events with a singular event that is a sealed class. All the UI should be able to be recreated based on this singular state class, and all interactions should be able to be replayed using only the event callback.
For a more detailed overview, see: https://www.youtube.com/watch?v=b2z1jvD4VMQ
This is part of the effort to make CloudStream cross platform, as it allows us to decouple UI and logic.
### 2. KMP-compatible libraries
We plan to leverage Kotlin's KMP project to compile our code to different architectures. However, this requires us to only use KMP-compatible libraries, no Java. Therefore any pull requests must ensure that they use KMP-compatible libraries only.
### 3. UI Changes
While migrating to the new compose UI, you also have the opportunity to change the UI. However, this should only be to freshen up the UI, not completely redesign it. It is also important to stress that this process should not lose any features of the old UI, and be very conservative with adding new features.

View file

@ -276,6 +276,8 @@ dependencies {
implementation(libs.jackson.module.kotlin) // JSON Parser implementation(libs.jackson.module.kotlin) // JSON Parser
implementation(libs.zipline) implementation(libs.zipline)
// Temp/deprecated; will be removed once extensions have time to migrate from using it
implementation("com.google.code.gson:gson:2.11.0")
// Deprecated; will be removed once extensions have time to migrate from using it // Deprecated; will be removed once extensions have time to migrate from using it
implementation("me.xdrop:fuzzywuzzy:1.4.0") implementation("me.xdrop:fuzzywuzzy:1.4.0")
@ -323,11 +325,9 @@ tasks.withType<KotlinJvmCompile> {
compilerOptions { compilerOptions {
jvmTarget.set(javaTarget) jvmTarget.set(javaTarget)
jvmDefault.set(JvmDefaultMode.ENABLE) jvmDefault.set(JvmDefaultMode.ENABLE)
freeCompilerArgs.add("-Xannotation-default-target=param-property")
optIn.addAll( optIn.addAll(
"com.lagradost.cloudstream3.InternalAPI", "com.lagradost.cloudstream3.InternalAPI",
"com.lagradost.cloudstream3.Prerelease", "com.lagradost.cloudstream3.Prerelease",
"kotlin.uuid.ExperimentalUuidApi",
) )
} }
} }

View file

@ -55,12 +55,6 @@ class ExampleInstrumentedTest {
return APIHolder.allProviders.toTypedArray() //.filter { !it.usesWebView } return APIHolder.allProviders.toTypedArray() //.filter { !it.usesWebView }
} }
@Test
fun providersExist() {
Assert.assertTrue(getAllProviders().isNotEmpty())
println("Done providersExist")
}
@Throws @Throws
private inline fun <reified T : ViewBinding> testAllLayouts( private inline fun <reified T : ViewBinding> testAllLayouts(
activity: Activity, activity: Activity,

View file

@ -136,9 +136,9 @@ class SerializationClassTester {
runCatching { Class.forName(it).kotlin }.getOrNull() runCatching { Class.forName(it).kotlin }.getOrNull()
}.filter { kClass -> }.filter { kClass ->
// Not possible to use .hasAnnotation() on newer Android versions. // Not possible to use .hasAnnotation() on newer Android versions.
kClass.java.annotations.any { kClass.java.annotations.any { it is Serializable }
it is Serializable && kClass.java.annotations.none { it is SkipSerializationTest }
} && kClass.java.annotations.none { it is SkipSerializationTest } && !kClass.isAbstract
} }
} }

View file

@ -1,157 +0,0 @@
package com.lagradost.cloudstream3.utils.serializers
import android.net.Uri
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.AppUtils.toJson
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.KeepGeneratedSerializer
import kotlinx.serialization.Serializable
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Test
@OptIn(ExperimentalSerializationApi::class)
@KeepGeneratedSerializer
@Serializable(with = NonEmptyData.Serializer::class)
data class NonEmptyData(
val title: String = "",
val tags: List<String> = emptyList(),
val meta: Map<String, String> = emptyMap(),
val name: String = "hello",
) {
object Serializer : NonEmptySerializer<NonEmptyData>(NonEmptyData.generatedSerializer())
}
@OptIn(ExperimentalSerializationApi::class)
@KeepGeneratedSerializer
@Serializable(with = WriteOnlyData.Serializer::class)
data class WriteOnlyData(
val fieldA: String = "",
val fieldB: String = "",
) {
object Serializer : WriteOnlySerializer<WriteOnlyData>(
WriteOnlyData.generatedSerializer(),
setOf("fieldB"),
)
}
@OptIn(ExperimentalSerializationApi::class)
@KeepGeneratedSerializer
@Serializable(with = MultiWriteOnly.Serializer::class)
data class MultiWriteOnly(
val fieldA: String = "",
val fieldB: String = "",
val fieldC: String = "",
) {
object Serializer : WriteOnlySerializer<MultiWriteOnly>(
MultiWriteOnly.generatedSerializer(),
setOf("fieldB", "fieldC"),
)
}
@Serializable
data class UriData(
@Serializable(with = UriSerializer::class)
val uri: Uri = Uri.EMPTY,
)
class SerializerTest {
@Test
fun nonEmptySerializerOmitsEmptyStrings() {
val data = NonEmptyData(title = "", name = "hello")
val result = data.toJson()
assertFalse(result.contains("title"))
assertTrue(result.contains("name"))
}
@Test
fun nonEmptySerializerOmitsEmptyLists() {
val data = NonEmptyData(tags = emptyList(), name = "hello")
val result = data.toJson()
assertFalse(result.contains("tags"))
}
@Test
fun nonEmptySerializerOmitsEmptyMaps() {
val data = NonEmptyData(meta = emptyMap(), name = "hello")
val result = data.toJson()
assertFalse(result.contains("meta"))
}
@Test
fun nonEmptySerializerKeepsNonEmptyFields() {
val data = NonEmptyData(title = "hello", tags = listOf("a"), meta = mapOf("k" to "v"))
val result = data.toJson()
assertTrue(result.contains("title"))
assertTrue(result.contains("tags"))
assertTrue(result.contains("meta"))
}
@Test
fun nonEmptySerializerDoesNotAffectDeserialization() {
val input = """{"title":"hello","tags":["a"],"meta":{"k":"v"},"name":"world"}"""
val result = parseJson<NonEmptyData>(input)
assertEquals("hello", result.title)
assertEquals(listOf("a"), result.tags)
assertEquals(mapOf("k" to "v"), result.meta)
assertEquals("world", result.name)
}
@Test
fun writeOnlySerializerOmitsFieldOnSerialize() {
val data = WriteOnlyData(fieldA = "hello", fieldB = "secret")
val result = data.toJson()
assertTrue(result.contains("fieldA"))
assertFalse(result.contains("fieldB"))
}
@Test
fun writeOnlySerializerDeserializesNormally() {
val input = """{"fieldA":"hello","fieldB":"secret"}"""
val result = parseJson<WriteOnlyData>(input)
assertEquals("hello", result.fieldA)
assertEquals("secret", result.fieldB)
}
@Test
fun writeOnlySerializerDeserializesMissingAsDefault() {
val input = """{"fieldA":"hello"}"""
val result = parseJson<WriteOnlyData>(input)
assertEquals("hello", result.fieldA)
assertEquals("", result.fieldB)
}
@Test
fun writeOnlySerializerHandlesMultipleKeys() {
val data = MultiWriteOnly(fieldA = "hello", fieldB = "secret1", fieldC = "secret2")
val result = data.toJson()
assertTrue(result.contains("fieldA"))
assertFalse(result.contains("fieldB"))
assertFalse(result.contains("fieldC"))
}
@Test
fun uriSerializerSerializesUriToString() {
val data = UriData(uri = Uri.parse("https://example.com/path?query=1"))
val result = data.toJson()
assertTrue(result.contains("https://example.com/path?query=1"))
}
@Test
fun uriSerializerDeserializesStringToUri() {
val input = """{"uri":"https://example.com/path?query=1"}"""
val result = parseJson<UriData>(input)
assertEquals(Uri.parse("https://example.com/path?query=1"), result.uri)
}
@Test
fun uriSerializerRoundtripsCorrectly() {
val data = UriData(uri = Uri.parse("https://example.com/path?query=1"))
val encoded = data.toJson()
val decoded = parseJson<UriData>(encoded)
assertEquals(data.uri, decoded.uri)
}
}

View file

@ -0,0 +1,41 @@
package com.lagradost.cloudstream3.utils.serializers
import android.net.Uri
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.AppUtils.toJson
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
@Serializable
data class UriData(
@Serializable(with = UriSerializer::class)
@SerialName("uri") val uri: Uri = Uri.EMPTY,
)
class UriSerializerTest {
@Test
fun uriSerializerSerializesUriToString() {
val data = UriData(uri = Uri.parse("https://example.com/path?query=1"))
val result = data.toJson()
assertTrue(result.contains("https://example.com/path?query=1"))
}
@Test
fun uriSerializerDeserializesStringToUri() {
val input = """{"uri":"https://example.com/path?query=1"}"""
val result = parseJson<UriData>(input)
assertEquals(Uri.parse("https://example.com/path?query=1"), result.uri)
}
@Test
fun uriSerializerRoundtripsCorrectly() {
val data = UriData(uri = Uri.parse("https://example.com/path?query=1"))
val encoded = data.toJson()
val decoded = parseJson<UriData>(encoded)
assertEquals(data.uri, decoded.uri)
}
}

View file

@ -7,7 +7,7 @@ package com.lagradost.cloudstream3
@Deprecated( @Deprecated(
message = "AcraApplication is deprecated, use CloudStreamApp instead", message = "AcraApplication is deprecated, use CloudStreamApp instead",
replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp"), replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp"),
level = DeprecationLevel.WARNING level = DeprecationLevel.ERROR
) )
class AcraApplication { class AcraApplication {
companion object { companion object {
@ -15,14 +15,14 @@ class AcraApplication {
@Deprecated( @Deprecated(
message = "AcraApplication is deprecated, use CloudStreamApp instead", message = "AcraApplication is deprecated, use CloudStreamApp instead",
replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.context"), replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.context"),
level = DeprecationLevel.WARNING level = DeprecationLevel.ERROR
) )
val context get() = CloudStreamApp.context val context get() = CloudStreamApp.context
@Deprecated( @Deprecated(
message = "AcraApplication is deprecated, use CloudStreamApp instead", message = "AcraApplication is deprecated, use CloudStreamApp instead",
replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.removeKeys(folder)"), replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.removeKeys(folder)"),
level = DeprecationLevel.WARNING level = DeprecationLevel.ERROR
) )
fun removeKeys(folder: String): Int? = fun removeKeys(folder: String): Int? =
CloudStreamApp.removeKeys(folder) CloudStreamApp.removeKeys(folder)
@ -30,7 +30,7 @@ class AcraApplication {
@Deprecated( @Deprecated(
message = "AcraApplication is deprecated, use CloudStreamApp instead", message = "AcraApplication is deprecated, use CloudStreamApp instead",
replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.setKey(path, value)"), replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.setKey(path, value)"),
level = DeprecationLevel.WARNING level = DeprecationLevel.ERROR
) )
fun <T> setKey(path: String, value: T) = fun <T> setKey(path: String, value: T) =
CloudStreamApp.setKey(path, value) CloudStreamApp.setKey(path, value)
@ -38,7 +38,7 @@ class AcraApplication {
@Deprecated( @Deprecated(
message = "AcraApplication is deprecated, use CloudStreamApp instead", message = "AcraApplication is deprecated, use CloudStreamApp instead",
replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.setKey(folder, path, value)"), replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.setKey(folder, path, value)"),
level = DeprecationLevel.WARNING level = DeprecationLevel.ERROR
) )
fun <T> setKey(folder: String, path: String, value: T) = fun <T> setKey(folder: String, path: String, value: T) =
CloudStreamApp.setKey(folder, path, value) CloudStreamApp.setKey(folder, path, value)
@ -46,7 +46,7 @@ class AcraApplication {
@Deprecated( @Deprecated(
message = "AcraApplication is deprecated, use CloudStreamApp instead", message = "AcraApplication is deprecated, use CloudStreamApp instead",
replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.getKey(path, defVal)"), replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.getKey(path, defVal)"),
level = DeprecationLevel.WARNING level = DeprecationLevel.ERROR
) )
inline fun <reified T : Any> getKey(path: String, defVal: T?): T? = inline fun <reified T : Any> getKey(path: String, defVal: T?): T? =
CloudStreamApp.getKey(path, defVal) CloudStreamApp.getKey(path, defVal)
@ -54,7 +54,7 @@ class AcraApplication {
@Deprecated( @Deprecated(
message = "AcraApplication is deprecated, use CloudStreamApp instead", message = "AcraApplication is deprecated, use CloudStreamApp instead",
replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.getKey(path)"), replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.getKey(path)"),
level = DeprecationLevel.WARNING level = DeprecationLevel.ERROR
) )
inline fun <reified T : Any> getKey(path: String): T? = inline fun <reified T : Any> getKey(path: String): T? =
CloudStreamApp.getKey(path) CloudStreamApp.getKey(path)
@ -62,7 +62,7 @@ class AcraApplication {
@Deprecated( @Deprecated(
message = "AcraApplication is deprecated, use CloudStreamApp instead", message = "AcraApplication is deprecated, use CloudStreamApp instead",
replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.getKey(folder, path)"), replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.getKey(folder, path)"),
level = DeprecationLevel.WARNING level = DeprecationLevel.ERROR
) )
inline fun <reified T : Any> getKey(folder: String, path: String): T? = inline fun <reified T : Any> getKey(folder: String, path: String): T? =
CloudStreamApp.getKey(folder, path) CloudStreamApp.getKey(folder, path)
@ -70,7 +70,7 @@ class AcraApplication {
@Deprecated( @Deprecated(
message = "AcraApplication is deprecated, use CloudStreamApp instead", message = "AcraApplication is deprecated, use CloudStreamApp instead",
replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.getKey(folder, path, defVal)"), replaceWith = ReplaceWith("com.lagradost.cloudstream3.CloudStreamApp.getKey(folder, path, defVal)"),
level = DeprecationLevel.WARNING level = DeprecationLevel.ERROR
) )
inline fun <reified T : Any> getKey(folder: String, path: String, defVal: T?): T? = inline fun <reified T : Any> getKey(folder: String, path: String, defVal: T?): T? =
CloudStreamApp.getKey(folder, path, defVal) CloudStreamApp.getKey(folder, path, defVal)

View file

@ -113,7 +113,7 @@ class CloudStreamApp : Application(), SingletonImageLoader.Factory {
get() = _context?.get() get() = _context?.get()
private set(value) { private set(value) {
_context = WeakReference(value) _context = WeakReference(value)
setContext(WeakReference(value)) setContext(value)
} }
fun <T : Any> getKeyClass(path: String, valueType: Class<T>): T? { fun <T : Any> getKeyClass(path: String, valueType: Class<T>): T? {

View file

@ -171,13 +171,17 @@ import com.lagradost.cloudstream3.utils.UIHelper.hideKeyboard
import com.lagradost.cloudstream3.utils.UIHelper.navigate import com.lagradost.cloudstream3.utils.UIHelper.navigate
import com.lagradost.cloudstream3.utils.UIHelper.requestRW import com.lagradost.cloudstream3.utils.UIHelper.requestRW
import com.lagradost.cloudstream3.utils.UIHelper.setNavigationBarColorCompat import com.lagradost.cloudstream3.utils.UIHelper.setNavigationBarColorCompat
import com.lagradost.cloudstream3.utils.UIHelper.showProgress
import com.lagradost.cloudstream3.utils.UIHelper.toPx import com.lagradost.cloudstream3.utils.UIHelper.toPx
import com.lagradost.cloudstream3.utils.USER_PROVIDER_API import com.lagradost.cloudstream3.utils.USER_PROVIDER_API
import com.lagradost.cloudstream3.utils.USER_SELECTED_HOMEPAGE_API import com.lagradost.cloudstream3.utils.USER_SELECTED_HOMEPAGE_API
import com.lagradost.cloudstream3.utils.downloader.DownloadQueueManager
import com.lagradost.cloudstream3.utils.setText import com.lagradost.cloudstream3.utils.setText
import com.lagradost.cloudstream3.utils.setTextHtml import com.lagradost.cloudstream3.utils.setTextHtml
import com.lagradost.cloudstream3.utils.txt import com.lagradost.cloudstream3.utils.txt
import com.lagradost.safefile.SafeFile import com.lagradost.safefile.SafeFile
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancel
import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.sync.withLock
import java.io.File import java.io.File
@ -187,10 +191,8 @@ import java.net.URLDecoder
import java.nio.charset.Charset import java.nio.charset.Charset
import kotlin.math.abs import kotlin.math.abs
import kotlin.math.absoluteValue import kotlin.math.absoluteValue
import kotlin.reflect.full.createInstance
import kotlin.system.exitProcess import kotlin.system.exitProcess
import com.lagradost.cloudstream3.utils.downloader.DownloadQueueManager
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancel
class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCallback { class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCallback {
companion object { companion object {
@ -784,7 +786,6 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
} }
} }
val builder = NavOptions.Builder().setLaunchSingleTop(true).setRestoreState(true) val builder = NavOptions.Builder().setLaunchSingleTop(true).setRestoreState(true)
.setEnterAnim(R.anim.enter_anim) .setEnterAnim(R.anim.enter_anim)
.setExitAnim(R.anim.exit_anim) .setExitAnim(R.anim.exit_anim)
@ -815,22 +816,24 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
try { try {
getKey<Array<SettingsGeneral.CustomSite>>(USER_PROVIDER_API)?.let { list -> getKey<Array<SettingsGeneral.CustomSite>>(USER_PROVIDER_API)?.let { list ->
list.forEach { custom -> list.forEach { custom ->
allProviders.firstOrNull { it.javaClass.simpleName == custom.parentJavaClass } allProviders.firstOrNull {
?.let { it::class.simpleName == custom.parentClassName
}?.let {
allProviders.add( allProviders.add(
it.javaClass.getDeclaredConstructor().newInstance() it::class.createInstance().apply {
.apply {
name = custom.name name = custom.name
lang = custom.lang lang = custom.lang
mainUrl = custom.url.trimEnd('/') mainUrl = custom.url.trimEnd('/')
canBeOverridden = false canBeOverridden = false
}) }
)
} }
} }
} }
// it.hashCode() is not enough to make sure they are distinct // it.hashCode() is not enough to make sure they are distinct
apis = apis = allProviders.distinctBy {
allProviders.distinctBy { it.lang + it.name + it.mainUrl + it.javaClass.name } it.lang + it.name + it.mainUrl + it::class.qualifiedName
}
APIHolder.apiMap = null APIHolder.apiMap = null
} catch (e: Exception) { } catch (e: Exception) {
logError(e) logError(e)
@ -1212,7 +1215,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
// backup when we update the app, I don't trust myself to not boot lock users, might want to make this a setting? // backup when we update the app, I don't trust myself to not boot lock users, might want to make this a setting?
safe { safe {
val appVer = BuildConfig.VERSION_NAME val appVer = BuildConfig.VERSION_NAME
val lastAppAutoBackup: String = getKey("VERSION_NAME") ?: "" val lastAppAutoBackup: String = getKey<String>("VERSION_NAME") ?: ""
if (appVer != lastAppAutoBackup) { if (appVer != lastAppAutoBackup) {
setKey("VERSION_NAME", BuildConfig.VERSION_NAME) setKey("VERSION_NAME", BuildConfig.VERSION_NAME)
if (lastAppAutoBackup.isEmpty()) return@safe if (lastAppAutoBackup.isEmpty()) return@safe
@ -1426,8 +1429,9 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
else -> { else -> {
resultviewPreviewBookmark.isEnabled = false resultviewPreviewBookmark.isEnabled = false
resultviewPreviewBookmark.setIconResource(R.drawable.ic_baseline_bookmark_border_24) resultviewPreviewBookmark.showProgress()
resultviewPreviewBookmark.setText(R.string.loading) //resultviewPreviewBookmark.setIconResource(R.drawable.ic_baseline_bookmark_border_24)
//resultviewPreviewBookmark.setText(R.string.loading)
} }
} }
} }
@ -2014,7 +2018,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
} }
try { try {
if (getKey(HAS_DONE_SETUP_KEY, false) != true) { if (getKey<Boolean>(HAS_DONE_SETUP_KEY, false) != true) {
navController.navigate(R.id.navigation_setup_language) navController.navigate(R.id.navigation_setup_language)
// If no plugins bring up extensions screen // If no plugins bring up extensions screen
} else if (PluginManager.getPluginsOnline().isEmpty() } else if (PluginManager.getPluginsOnline().isEmpty()

View file

@ -42,7 +42,6 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import java.util.concurrent.Callable import java.util.concurrent.Callable
import java.util.concurrent.FutureTask import java.util.concurrent.FutureTask
import kotlin.reflect.jvm.jvmName
object VideoClickActionHolder { object VideoClickActionHolder {
val allVideoClickActions = atomicListOf( val allVideoClickActions = atomicListOf(
@ -161,7 +160,7 @@ abstract class VideoClickAction {
} }
} }
fun uniqueId() = "$sourcePlugin:${this::class.jvmName}" fun uniqueId() = "$sourcePlugin:${this::class.qualifiedName}"
@Throws @Throws
abstract fun shouldShow(context: Context?, video: ResultEpisode?): Boolean abstract fun shouldShow(context: Context?, video: ResultEpisode?): Boolean

View file

@ -60,7 +60,7 @@ open class VlcPackage: OpenInAppAction(
intent.putExtra("secure_uri", true) intent.putExtra("secure_uri", true)
intent.putExtra("title", video.name) intent.putExtra("title", video.name)
val subsLang = getKey(SUBTITLE_AUTO_SELECT_KEY) ?: "en" val subsLang = getKey<String>(SUBTITLE_AUTO_SELECT_KEY) ?: "en"
result.subs.firstOrNull { result.subs.firstOrNull {
subsLang == it.languageCode subsLang == it.languageCode
}?.let { }?.let {

View file

@ -1,5 +1,9 @@
package com.lagradost.cloudstream3.actions.temp.fcast package com.lagradost.cloudstream3.actions.temp.fcast
import com.fasterxml.jackson.annotation.JsonProperty
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
// See https://gitlab.com/futo-org/fcast/-/wikis/Protocol-version-1 // See https://gitlab.com/futo-org/fcast/-/wikis/Protocol-version-1
enum class Opcode(val value: Byte) { enum class Opcode(val value: Byte) {
None(0), None(0),
@ -18,18 +22,18 @@ enum class Opcode(val value: Byte) {
Pong(13); Pong(13);
} }
@Serializable
data class PlayMessage( data class PlayMessage(
val container: String, @JsonProperty("container") @SerialName("container") val container: String,
val url: String? = null, @JsonProperty("url") @SerialName("url") val url: String? = null,
val content: String? = null, @JsonProperty("content") @SerialName("content") val content: String? = null,
val time: Double? = null, @JsonProperty("time") @SerialName("time") val time: Double? = null,
val speed: Double? = null, @JsonProperty("speed") @SerialName("speed") val speed: Double? = null,
val headers: Map<String, String>? = null @JsonProperty("headers") @SerialName("headers") val headers: Map<String, String>? = null,
) )
data class SeekMessage( data class SeekMessage(
val time: Double val time: Double,
) )
data class PlaybackUpdateMessage( data class PlaybackUpdateMessage(
@ -37,26 +41,26 @@ data class PlaybackUpdateMessage(
val time: Double, val time: Double,
val duration: Double, val duration: Double,
val state: Int, val state: Int,
val speed: Double val speed: Double,
) )
data class VolumeUpdateMessage( data class VolumeUpdateMessage(
val generationTime: Long, val generationTime: Long,
val volume: Double val volume: Double,
) )
data class PlaybackErrorMessage( data class PlaybackErrorMessage(
val message: String val message: String,
) )
data class SetSpeedMessage( data class SetSpeedMessage(
val speed: Double val speed: Double,
) )
data class SetVolumeMessage( data class SetVolumeMessage(
val volume: Double val volume: Double,
) )
data class VersionMessage( data class VersionMessage(
val version: Long val version: Long,
) )

View file

@ -22,7 +22,6 @@ fun Requests.initClient(context: Context) {
} }
/** Only use ignoreSSL if you know what you are doing*/ /** Only use ignoreSSL if you know what you are doing*/
@Prerelease
fun Requests.initClient(context: Context, ignoreSSL: Boolean = false) { fun Requests.initClient(context: Context, ignoreSSL: Boolean = false) {
this.baseClient = buildDefaultClient(context, ignoreSSL) this.baseClient = buildDefaultClient(context, ignoreSSL)
} }
@ -34,7 +33,6 @@ fun buildDefaultClient(context: Context): OkHttpClient {
} }
/** Only use ignoreSSL if you know what you are doing*/ /** Only use ignoreSSL if you know what you are doing*/
@Prerelease
fun buildDefaultClient(context: Context, ignoreSSL: Boolean = false): OkHttpClient { fun buildDefaultClient(context: Context, ignoreSSL: Boolean = false): OkHttpClient {
safe { Security.insertProviderAt(Conscrypt.newProvider(), 1) } safe { Security.insertProviderAt(Conscrypt.newProvider(), 1) }

View file

@ -176,11 +176,11 @@ object PluginManager {
fun getPluginsOnline(): Array<PluginData> { fun getPluginsOnline(): Array<PluginData> {
return getKey(PLUGINS_KEY) ?: emptyArray() return getKey<Array<PluginData>>(PLUGINS_KEY) ?: emptyArray()
} }
fun getPluginsLocal(): Array<PluginData> { fun getPluginsLocal(): Array<PluginData> {
return getKey(PLUGINS_KEY_LOCAL) ?: emptyArray() return getKey<Array<PluginData>>(PLUGINS_KEY_LOCAL) ?: emptyArray()
} }
private val CLOUD_STREAM_FOLDER = private val CLOUD_STREAM_FOLDER =
@ -224,17 +224,17 @@ object PluginManager {
// Helper class for updateAllOnlinePluginsAndLoadThem // Helper class for updateAllOnlinePluginsAndLoadThem
data class OnlinePluginData( data class OnlinePluginData(
val savedData: PluginData, val savedData: PluginData,
val onlineData: Pair<String, SitePlugin>, val onlineData: PluginWrapper,
) { ) {
val isOutdated = val isOutdated =
onlineData.second.version > savedData.version || onlineData.second.version == PLUGIN_VERSION_ALWAYS_UPDATE onlineData.plugin.version > savedData.version || onlineData.plugin.version == PLUGIN_VERSION_ALWAYS_UPDATE
val isDisabled = onlineData.second.status == PROVIDER_STATUS_DOWN val isDisabled = onlineData.plugin.status == PROVIDER_STATUS_DOWN
fun validOnlineData(context: Context): Boolean { fun validOnlineData(context: Context): Boolean {
return getPluginPath( return getPluginPath(
context, context,
savedData.internalName, savedData.internalName,
onlineData.first onlineData.repositoryData.url
).absolutePath == savedData.filePath ).absolutePath == savedData.filePath
} }
} }
@ -282,19 +282,19 @@ object PluginManager {
?: emptyArray()) + PREBUILT_REPOSITORIES ?: emptyArray()) + PREBUILT_REPOSITORIES
val onlinePlugins = urls.toList().amap { val onlinePlugins = urls.toList().amap {
getRepoPlugins(it.url)?.toList() ?: emptyList() getRepoPlugins(it) ?: emptyList()
}.flatten().distinctBy { it.second.url } }.flatten().distinctBy { it.plugin.url }
// Iterates over all offline plugins, compares to remote repo and returns the plugins which are outdated // Iterates over all offline plugins, compares to remote repo and returns the plugins which are outdated
val outdatedPlugins = getPluginsOnline().map { savedData -> val outdatedPlugins = getPluginsOnline().map { savedData ->
onlinePlugins onlinePlugins
.filter { onlineData -> savedData.internalName == onlineData.second.internalName } .filter { onlineData -> savedData.internalName == onlineData.plugin.internalName }
.map { onlineData -> .map { onlineData ->
OnlinePluginData(savedData, onlineData) OnlinePluginData(savedData, onlineData)
}.filter { }.filter {
it.validOnlineData(activity) it.validOnlineData(activity)
} }
}.flatten().distinctBy { it.onlineData.second.url } }.flatten().distinctBy { it.onlineData.plugin.url }
debugPrint { debugPrint {
"Outdated plugins: ${outdatedPlugins.filter { it.isOutdated }}" "Outdated plugins: ${outdatedPlugins.filter { it.isOutdated }}"
@ -309,14 +309,14 @@ object PluginManager {
} else if (pluginData.isOutdated) { } else if (pluginData.isOutdated) {
downloadPlugin( downloadPlugin(
activity, activity,
pluginData.onlineData.second.url, pluginData.onlineData.plugin.url,
pluginData.onlineData.second.fileHash, pluginData.onlineData.plugin.fileHash,
pluginData.savedData.internalName, pluginData.savedData.internalName,
File(pluginData.savedData.filePath), File(pluginData.savedData.filePath),
true true
).let { success -> ).let { success ->
if (success) if (success)
updatedPlugins.add(pluginData.onlineData.second.name) updatedPlugins.add(pluginData.onlineData.plugin.name)
} }
} }
} }
@ -359,15 +359,15 @@ object PluginManager {
val urls = (getKey<Array<RepositoryData>>(REPOSITORIES_KEY) val urls = (getKey<Array<RepositoryData>>(REPOSITORIES_KEY)
?: emptyArray()) + PREBUILT_REPOSITORIES ?: emptyArray()) + PREBUILT_REPOSITORIES
val onlinePlugins = urls.toList().amap { val onlinePlugins = urls.toList().amap {
getRepoPlugins(it.url)?.toList() ?: emptyList() getRepoPlugins(it)?.toList() ?: emptyList()
}.flatten().distinctBy { it.second.url } }.flatten().distinctBy { it.plugin.url }
val providerLang = activity.getApiProviderLangSettings() val providerLang = activity.getApiProviderLangSettings()
//Log.i(TAG, "providerLang => ${providerLang.toJson()}") //Log.i(TAG, "providerLang => ${providerLang.toJson()}")
// Iterate online repos and returns not downloaded plugins // Iterate online repos and returns not downloaded plugins
val notDownloadedPlugins = onlinePlugins.mapNotNull { onlineData -> val notDownloadedPlugins = onlinePlugins.mapNotNull { onlineData ->
val sitePlugin = onlineData.second val sitePlugin = onlineData.plugin
val tvtypes = sitePlugin.tvTypes ?: listOf() val tvtypes = sitePlugin.tvTypes ?: listOf()
//Don't include empty urls //Don't include empty urls
@ -379,7 +379,7 @@ object PluginManager {
} }
//Omit already existing plugins //Omit already existing plugins
if (getPluginPath(activity, sitePlugin.internalName, onlineData.first).exists()) { if (getPluginPath(activity, sitePlugin.internalName, onlineData.repositoryData.url).exists()) {
Log.i(TAG, "Skip > ${sitePlugin.internalName}") Log.i(TAG, "Skip > ${sitePlugin.internalName}")
return@mapNotNull null return@mapNotNull null
} }
@ -421,14 +421,14 @@ object PluginManager {
notDownloadedPlugins.amap { pluginData -> notDownloadedPlugins.amap { pluginData ->
downloadPlugin( downloadPlugin(
activity, activity,
pluginData.onlineData.second.url, pluginData.onlineData.plugin.url,
pluginData.onlineData.second.fileHash, pluginData.onlineData.plugin.fileHash,
pluginData.savedData.internalName, pluginData.savedData.internalName,
pluginData.onlineData.first, pluginData.onlineData.repositoryData.url,
!pluginData.isDisabled !pluginData.isDisabled
).let { success -> ).let { success ->
if (success) if (success)
newDownloadPlugins.add(pluginData.onlineData.second.name) newDownloadPlugins.add(pluginData.onlineData.plugin.name)
} }
} }
@ -512,6 +512,9 @@ object PluginManager {
val res = dir.mkdirs() val res = dir.mkdirs()
if (!res) { if (!res) {
Log.w(TAG, "Failed to create local directories") Log.w(TAG, "Failed to create local directories")
// We have tried to load local plugins, but exit early.
// This needs to be true to prevent the downloader waiting for plugins.
loadedLocalPlugins = true
return return
} }
} }
@ -835,16 +838,16 @@ object PluginManager {
val urls = (getKey<Array<RepositoryData>>(REPOSITORIES_KEY) val urls = (getKey<Array<RepositoryData>>(REPOSITORIES_KEY)
?: emptyArray()) + PREBUILT_REPOSITORIES ?: emptyArray()) + PREBUILT_REPOSITORIES
val onlinePlugins = urls.toList().amap { val onlinePlugins = urls.toList().amap {
getRepoPlugins(it.url)?.toList() ?: emptyList() getRepoPlugins(it) ?: emptyList()
}.flatten().distinctBy { it.second.url } }.flatten().distinctBy { it.plugin.url }
val allPlugins = getPluginsOnline().flatMap { savedData -> val allPlugins = getPluginsOnline().flatMap { savedData ->
onlinePlugins onlinePlugins
.filter { it.second.internalName == savedData.internalName } .filter { it.plugin.internalName == savedData.internalName }
.mapNotNull { onlineData -> .mapNotNull { onlineData ->
OnlinePluginData(savedData, onlineData).takeIf { it.validOnlineData(activity) } OnlinePluginData(savedData, onlineData).takeIf { it.validOnlineData(activity) }
} }
}.distinctBy { it.onlineData.second.url } }.distinctBy { it.onlineData.plugin.url }
val updatedPlugins = mutableListOf<String>() val updatedPlugins = mutableListOf<String>()
@ -852,7 +855,7 @@ object PluginManager {
if (pluginData.isDisabled) { if (pluginData.isDisabled) {
Log.e( Log.e(
"PluginManager", "PluginManager",
"Unloading disabled plugin: ${pluginData.onlineData.second.name}" "Unloading disabled plugin: ${pluginData.onlineData.plugin.name}"
) )
unloadPlugin(pluginData.savedData.filePath) unloadPlugin(pluginData.savedData.filePath)
} else { } else {
@ -861,14 +864,14 @@ object PluginManager {
if (downloadPlugin( if (downloadPlugin(
activity, activity,
pluginData.onlineData.second.url, pluginData.onlineData.plugin.url,
pluginData.onlineData.second.fileHash, pluginData.onlineData.plugin.fileHash,
pluginData.savedData.internalName, pluginData.savedData.internalName,
existingFile, existingFile,
true true
) )
) { ) {
updatedPlugins.add(pluginData.onlineData.second.name) updatedPlugins.add(pluginData.onlineData.plugin.name)
} }
} }
}.also { }.also {

View file

@ -75,10 +75,30 @@ data class SitePlugin(
@JsonProperty("fileHash") @SerialName("fileHash") val fileHash: String?, @JsonProperty("fileHash") @SerialName("fileHash") val fileHash: String?,
) )
@Serializable
data class PluginWrapper(
@JsonProperty("repository") @SerialName("repository") val repository: Repository,
@JsonProperty("repositoryData") @SerialName("repositoryData") val repositoryData: RepositoryData,
@JsonProperty("plugin") @SerialName("plugin") val plugin: SitePlugin
) {
companion object {
private val localRepository = Repository("", "", "", 1, emptyList())
private val localRepositoryData = RepositoryData("", "", "")
fun getLocalPluginWrapper(plugin: SitePlugin): PluginWrapper {
return PluginWrapper(
localRepository,
localRepositoryData,
plugin
)
}
}
}
object RepositoryManager { object RepositoryManager {
const val ONLINE_PLUGINS_FOLDER = "Extensions" const val ONLINE_PLUGINS_FOLDER = "Extensions"
val PREBUILT_REPOSITORIES: Array<RepositoryData> by lazy { val PREBUILT_REPOSITORIES: Array<RepositoryData> by lazy {
getKey("PREBUILT_REPOSITORIES") ?: emptyArray() getKey<Array<RepositoryData>>("PREBUILT_REPOSITORIES") ?: emptyArray()
} }
private val GH_REGEX = private val GH_REGEX =
Regex("^https://raw.githubusercontent.com/([A-Za-z0-9-]+)/([A-Za-z0-9_.-]+)/(.*)$") Regex("^https://raw.githubusercontent.com/([A-Za-z0-9-]+)/([A-Za-z0-9_.-]+)/(.*)$")
@ -121,21 +141,28 @@ object RepositoryManager {
} }
} else if (fixedUrl.matches("^[a-zA-Z0-9!_-]+$".toRegex())) { } else if (fixedUrl.matches("^[a-zA-Z0-9!_-]+$".toRegex())) {
safeAsync { safeAsync {
app.get("https://cutt.ly/${fixedUrl}", allowRedirects = false).let { it2 -> if (fixedUrl.startsWith("!")) {
it2.headers["Location"]?.let { url -> val response = app.get("https://py.md/${fixedUrl.removePrefix("!")}", allowRedirects = false)
val url = response.headers["Location"] ?: return@safeAsync null
if (url.startsWith("https://py.md/404")) return@safeAsync null
if (url.removeSuffix("/") == "https://py.md") return@safeAsync null
return@safeAsync url
} else {
val response = app.get("https://cutt.ly/${fixedUrl}", allowRedirects = false)
val url = response.headers["Location"] ?: return@safeAsync null
if (url.startsWith("https://cutt.ly/404")) return@safeAsync null if (url.startsWith("https://cutt.ly/404")) return@safeAsync null
if (url.removeSuffix("/") == "https://cutt.ly") return@safeAsync null if (url.removeSuffix("/") == "https://cutt.ly") return@safeAsync null
return@safeAsync url return@safeAsync url
} }
} }
}
} else null } else null
} }
suspend fun parseRepository(url: String): Repository? { suspend fun parseRepository(url: String): Repository? {
return safeAsync { return safeAsync {
// Take manifestVersion and such into account later // Take manifestVersion and such into account later
app.get(convertRawGitUrl(url), cacheTime = 5, cacheUnit = TimeUnit.MINUTES).parsedSafe<Repository>() app.get(convertRawGitUrl(url), cacheTime = 5, cacheUnit = TimeUnit.MINUTES)
.parsedSafe<Repository>()
} }
} }
@ -153,13 +180,14 @@ object RepositoryManager {
/** /**
* Gets all plugins from repositories and pairs them with the repository url * Gets all plugins from repositories and pairs them with the repository url
*/ */
suspend fun getRepoPlugins(repositoryUrl: String): List<Pair<String, SitePlugin>>? { suspend fun getRepoPlugins(repositoryData: RepositoryData): List<PluginWrapper>? {
val repo = parseRepository(repositoryUrl) ?: return null val repo = parseRepository(repositoryData.url) ?: return null
return repo.pluginLists.amap { url -> val list = repo.pluginLists.amap { url ->
parsePlugins(url).map { parsePlugins(url).map {
repositoryUrl to it PluginWrapper(repo, repositoryData, it)
} }
}.flatten() }.flatten()
return list
} }
suspend fun downloadPluginToFile( suspend fun downloadPluginToFile(
@ -212,7 +240,7 @@ object RepositoryManager {
} }
fun getRepositories(): Array<RepositoryData> { fun getRepositories(): Array<RepositoryData> {
return getKey(REPOSITORIES_KEY) ?: emptyArray() return getKey<Array<RepositoryData>>(REPOSITORIES_KEY) ?: emptyArray()
} }
// Don't want to read before we write in another thread // Don't want to read before we write in another thread

View file

@ -52,8 +52,8 @@ object VotingApi {
votesCache[pluginUrl] = it votesCache[pluginUrl] = it
} }
fun hasVoted(pluginUrl: String) = fun hasVoted(pluginUrl: String): Boolean =
getKey("cs3-votes/${transformUrl(pluginUrl)}") ?: false getKey<Boolean>("cs3-votes/${transformUrl(pluginUrl)}") ?: false
fun canVote(pluginUrl: String): Boolean = fun canVote(pluginUrl: String): Boolean =
PluginManager.urlPlugins.contains(pluginUrl) PluginManager.urlPlugins.contains(pluginUrl)

View file

@ -70,7 +70,8 @@ abstract class AccountManager {
SubtitleRepo(openSubtitlesApi), SubtitleRepo(openSubtitlesApi),
SubtitleRepo(addic7ed), SubtitleRepo(addic7ed),
SubtitleRepo(subDlApi), SubtitleRepo(subDlApi),
PlainAuthRepo(animeSkipApi) PlainAuthRepo(animeSkipApi),
SubtitleRepo(subSourceApi)
) )
fun updateAccountIds() { fun updateAccountIds() {
@ -120,7 +121,8 @@ abstract class AccountManager {
val subtitleProviders = arrayOf( val subtitleProviders = arrayOf(
SubtitleRepo(openSubtitlesApi), SubtitleRepo(openSubtitlesApi),
SubtitleRepo(addic7ed), SubtitleRepo(addic7ed),
SubtitleRepo(subDlApi) SubtitleRepo(subDlApi),
SubtitleRepo(subSourceApi)
) )
val syncApis = arrayOf( val syncApis = arrayOf(
SyncRepo(malApi), SyncRepo(malApi),

View file

@ -6,13 +6,12 @@ import com.lagradost.cloudstream3.APIHolder
import com.lagradost.cloudstream3.APIHolder.unixTime import com.lagradost.cloudstream3.APIHolder.unixTime
import com.lagradost.cloudstream3.APIHolder.unixTimeMS import com.lagradost.cloudstream3.APIHolder.unixTimeMS
import com.lagradost.cloudstream3.base64Encode import com.lagradost.cloudstream3.base64Encode
import com.lagradost.cloudstream3.splitUrlParameters
import com.lagradost.cloudstream3.syncproviders.AccountManager.Companion.APP_STRING import com.lagradost.cloudstream3.syncproviders.AccountManager.Companion.APP_STRING
import com.lagradost.cloudstream3.utils.AppContextUtils.splitQuery
import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonNames import kotlinx.serialization.json.JsonNames
import java.net.URI
import java.security.SecureRandom import java.security.SecureRandom
data class AuthLoginPage( data class AuthLoginPage(
@ -172,10 +171,8 @@ abstract class AuthAPI {
get() = unixTimeMS get() = unixTimeMS
fun splitRedirectUrl(redirectUrl: String): Map<String, String> { fun splitRedirectUrl(redirectUrl: String): Map<String, String> {
return splitQuery( return splitUrlParameters(
URI(
redirectUrl.replace(APP_STRING, "https").replace("/#", "?") redirectUrl.replace(APP_STRING, "https").replace("/#", "?")
).toURL()
) )
} }

View file

@ -2,7 +2,6 @@ package com.lagradost.cloudstream3.syncproviders
import androidx.annotation.WorkerThread import androidx.annotation.WorkerThread
import com.lagradost.cloudstream3.APIHolder.unixTime import com.lagradost.cloudstream3.APIHolder.unixTime
import com.lagradost.cloudstream3.ErrorLoadingException
import com.lagradost.cloudstream3.subtitles.AbstractSubtitleEntities.SubtitleEntity import com.lagradost.cloudstream3.subtitles.AbstractSubtitleEntities.SubtitleEntity
import com.lagradost.cloudstream3.subtitles.AbstractSubtitleEntities.SubtitleSearch import com.lagradost.cloudstream3.subtitles.AbstractSubtitleEntities.SubtitleSearch
import com.lagradost.cloudstream3.subtitles.SubtitleResource import com.lagradost.cloudstream3.subtitles.SubtitleResource
@ -14,7 +13,8 @@ class SubtitleRepo(override val api: SubtitleAPI) : AuthRepo(api) {
data class SavedSearchResponse( data class SavedSearchResponse(
val unixTime: Long, val unixTime: Long,
val response: List<SubtitleEntity>, val response: List<SubtitleEntity>,
val query: SubtitleSearch val query: SubtitleSearch,
val idPrefix: String,
) )
data class SavedResourceResponse( data class SavedResourceResponse(
@ -66,7 +66,7 @@ class SubtitleRepo(override val api: SubtitleAPI) : AuthRepo(api) {
var found: List<SubtitleEntity>? = null var found: List<SubtitleEntity>? = null
for (item in searchCache) { for (item in searchCache) {
// 120 min save // 120 min save
if (item.query == query && (unixTime - item.unixTime) < 60 * 120) { if (item.idPrefix == idPrefix && item.query == query && (unixTime - item.unixTime) < 60 * 120) {
found = item.response found = item.response
break break
} }
@ -79,7 +79,7 @@ class SubtitleRepo(override val api: SubtitleAPI) : AuthRepo(api) {
// only cache valid return values // only cache valid return values
if (returnValue.isNotEmpty()) { if (returnValue.isNotEmpty()) {
val add = SavedSearchResponse(unixTime, returnValue, query) val add = SavedSearchResponse(unixTime, returnValue, query, idPrefix)
searchCache.withLock { searchCache.withLock {
if (searchCache.size > CACHE_SIZE) { if (searchCache.size > CACHE_SIZE) {
searchCache[searchCacheIndex] = add // rolling cache searchCache[searchCacheIndex] = add // rolling cache

View file

@ -27,9 +27,10 @@ import com.lagradost.cloudstream3.ui.library.ListSorting
import com.lagradost.cloudstream3.utils.AppUtils.parseJson import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.AppUtils.toJson import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.cloudstream3.utils.DataStore.toKotlinObject
import com.lagradost.cloudstream3.utils.DataStoreHelper.toYear import com.lagradost.cloudstream3.utils.DataStoreHelper.toYear
import com.lagradost.cloudstream3.utils.txt import com.lagradost.cloudstream3.utils.txt
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.net.URLEncoder import java.net.URLEncoder
import java.util.Locale import java.util.Locale
@ -81,7 +82,6 @@ class AniListApi : SyncAPI() {
override fun urlToId(url: String): String? = override fun urlToId(url: String): String? =
url.removePrefix("$mainUrl/anime/").removeSuffix("/") url.removePrefix("$mainUrl/anime/").removeSuffix("/")
private fun getUrlFromId(id: Int): String { private fun getUrlFromId(id: Int): String {
return "$mainUrl/anime/$id" return "$mainUrl/anime/$id"
} }
@ -103,7 +103,6 @@ class AniListApi : SyncAPI() {
val internalId = (Regex("anilist\\.co/anime/(\\d*)").find(id)?.groupValues?.getOrNull(1) val internalId = (Regex("anilist\\.co/anime/(\\d*)").find(id)?.groupValues?.getOrNull(1)
?: id).toIntOrNull() ?: throw ErrorLoadingException("Invalid internalId") ?: id).toIntOrNull() ?: throw ErrorLoadingException("Invalid internalId")
val season = getSeason(internalId).data.media val season = getSeason(internalId).data.media
return SyncAPI.SyncResult( return SyncAPI.SyncResult(
season.id.toString(), season.id.toString(),
nextAiring = season.nextAiringEpisode?.let { nextAiring = season.nextAiringEpisode?.let {
@ -164,7 +163,6 @@ class AniListApi : SyncAPI() {
override suspend fun status(auth: AuthData?, id: String): SyncAPI.AbstractSyncStatus? { override suspend fun status(auth: AuthData?, id: String): SyncAPI.AbstractSyncStatus? {
val internalId = id.toIntOrNull() ?: return null val internalId = id.toIntOrNull() ?: return null
val data = getDataAboutId(auth ?: return null, internalId) ?: return null val data = getDataAboutId(auth ?: return null, internalId) ?: return null
return SyncAPI.SyncStatus( return SyncAPI.SyncStatus(
score = Score.from100(data.score), score = Score.from100(data.score),
watchedEpisodes = data.progress, watchedEpisodes = data.progress,
@ -260,11 +258,10 @@ class AniListApi : SyncAPI() {
val data = val data =
mapOf( mapOf(
"query" to query, "query" to query,
"variables" to "variables" to Variables(
mapOf( search = name,
"search" to name, page = 1,
"page" to 1, type = "ANIME",
"type" to "ANIME"
).toJson() ).toJson()
) )
@ -274,10 +271,11 @@ class AniListApi : SyncAPI() {
data = data, // (if (vars == null) mapOf("query" to q) else mapOf("query" to q, "variables" to vars)) data = data, // (if (vars == null) mapOf("query" to q) else mapOf("query" to q, "variables" to vars))
timeout = 5000 // REASONABLE TIMEOUT timeout = 5000 // REASONABLE TIMEOUT
).text.replace("\\", "") ).text.replace("\\", "")
return res.toKotlinObject() return parseJson<GetSearchRoot>(res)
} catch (e: Exception) { } catch (e: Exception) {
logError(e) logError(e)
} }
return null return null
} }
@ -458,7 +456,7 @@ class AniListApi : SyncAPI() {
cacheTime = 0, cacheTime = 0,
).text ).text
return tryParseJson(data) ?: throw ErrorLoadingException("Error parsing $data") return tryParseJson<SeasonResponse>(data) ?: throw ErrorLoadingException("Error parsing $data")
} }
} }
@ -506,7 +504,6 @@ class AniListApi : SyncAPI() {
type = AniListStatusType.None, type = AniListStatusType.None,
) )
} }
} }
private suspend fun postApi(token: AuthToken, q: String, cache: Boolean = false): String? { private suspend fun postApi(token: AuthToken, q: String, cache: Boolean = false): String? {
@ -527,66 +524,79 @@ class AniListApi : SyncAPI() {
).text.replace("\\/", "/") ).text.replace("\\/", "/")
} }
@Serializable
data class Variables(
@JsonProperty("search") @SerialName("search") val search: String,
@JsonProperty("page") @SerialName("page") val page: Int,
@JsonProperty("type") @SerialName("type") val type: String,
)
@Serializable
data class MediaRecommendation( data class MediaRecommendation(
@JsonProperty("id") val id: Int, @JsonProperty("id") @SerialName("id") val id: Int,
@JsonProperty("title") val title: Title?, @JsonProperty("title") @SerialName("title") val title: Title?,
@JsonProperty("idMal") val idMal: Int?, @JsonProperty("idMal") @SerialName("idMal") val idMal: Int?,
@JsonProperty("coverImage") val coverImage: CoverImage?, @JsonProperty("coverImage") @SerialName("coverImage") val coverImage: CoverImage?,
@JsonProperty("averageScore") val averageScore: Int? @JsonProperty("averageScore") @SerialName("averageScore") val averageScore: Int?,
) )
@Serializable
data class FullAnilistList( data class FullAnilistList(
@JsonProperty("data") val data: Data? @JsonProperty("data") @SerialName("data") val data: Data?,
) )
@Serializable
data class CompletedAt( data class CompletedAt(
@JsonProperty("year") val year: Int, @JsonProperty("year") @SerialName("year") val year: Int,
@JsonProperty("month") val month: Int, @JsonProperty("month") @SerialName("month") val month: Int,
@JsonProperty("day") val day: Int @JsonProperty("day") @SerialName("day") val day: Int,
) )
@Serializable
data class StartedAt( data class StartedAt(
@JsonProperty("year") val year: String?, @JsonProperty("year") @SerialName("year") val year: String?,
@JsonProperty("month") val month: String?, @JsonProperty("month") @SerialName("month") val month: String?,
@JsonProperty("day") val day: String? @JsonProperty("day") @SerialName("day") val day: String?,
) )
@Serializable
data class Title( data class Title(
@JsonProperty("english") val english: String?, @JsonProperty("english") @SerialName("english") val english: String?,
@JsonProperty("romaji") val romaji: String? @JsonProperty("romaji") @SerialName("romaji") val romaji: String?,
) )
@Serializable
data class CoverImage( data class CoverImage(
@JsonProperty("medium") val medium: String?, @JsonProperty("medium") @SerialName("medium") val medium: String?,
@JsonProperty("large") val large: String?, @JsonProperty("large") @SerialName("large") val large: String?,
@JsonProperty("extraLarge") val extraLarge: String? @JsonProperty("extraLarge") @SerialName("extraLarge") val extraLarge: String?,
) )
@Serializable
data class Media( data class Media(
@JsonProperty("id") val id: Int, @JsonProperty("id") @SerialName("id") val id: Int,
@JsonProperty("idMal") val idMal: Int?, @JsonProperty("idMal") @SerialName("idMal") val idMal: Int?,
@JsonProperty("season") val season: String?, @JsonProperty("season") @SerialName("season") val season: String?,
@JsonProperty("seasonYear") val seasonYear: Int, @JsonProperty("seasonYear") @SerialName("seasonYear") val seasonYear: Int,
@JsonProperty("format") val format: String?, @JsonProperty("format") @SerialName("format") val format: String?,
//@JsonProperty("source") val source: String, @JsonProperty("episodes") @SerialName("episodes") val episodes: Int,
@JsonProperty("episodes") val episodes: Int, @JsonProperty("title") @SerialName("title") val title: Title,
@JsonProperty("title") val title: Title, @JsonProperty("description") @SerialName("description") val description: String?,
@JsonProperty("description") val description: String?, @JsonProperty("coverImage") @SerialName("coverImage") val coverImage: CoverImage,
@JsonProperty("coverImage") val coverImage: CoverImage, @JsonProperty("synonyms") @SerialName("synonyms") val synonyms: List<String>,
@JsonProperty("synonyms") val synonyms: List<String>, @JsonProperty("nextAiringEpisode") @SerialName("nextAiringEpisode") val nextAiringEpisode: SeasonNextAiringEpisode?,
@JsonProperty("nextAiringEpisode") val nextAiringEpisode: SeasonNextAiringEpisode?,
) )
@Serializable
data class Entries( data class Entries(
@JsonProperty("status") val status: String?, @JsonProperty("status") @SerialName("status") val status: String?,
@JsonProperty("completedAt") val completedAt: CompletedAt, @JsonProperty("completedAt") @SerialName("completedAt") val completedAt: CompletedAt,
@JsonProperty("startedAt") val startedAt: StartedAt, @JsonProperty("startedAt") @SerialName("startedAt") val startedAt: StartedAt,
@JsonProperty("updatedAt") val updatedAt: Int, @JsonProperty("updatedAt") @SerialName("updatedAt") val updatedAt: Int,
@JsonProperty("progress") val progress: Int, @JsonProperty("progress") @SerialName("progress") val progress: Int,
@JsonProperty("score") val score: Int, @JsonProperty("score") @SerialName("score") val score: Int,
@JsonProperty("private") val private: Boolean, @JsonProperty("private") @SerialName("private") val private: Boolean,
@JsonProperty("media") val media: Media @JsonProperty("media") @SerialName("media") val media: Media,
) { ) {
fun toLibraryItem(): SyncAPI.LibraryItem { fun toLibraryItem(): SyncAPI.LibraryItem {
return SyncAPI.LibraryItem( return SyncAPI.LibraryItem(
@ -613,17 +623,20 @@ class AniListApi : SyncAPI() {
} }
} }
@Serializable
data class Lists( data class Lists(
@JsonProperty("status") val status: String?, @JsonProperty("status") @SerialName("status") val status: String?,
@JsonProperty("entries") val entries: List<Entries> @JsonProperty("entries") @SerialName("entries") val entries: List<Entries>,
) )
@Serializable
data class MediaListCollection( data class MediaListCollection(
@JsonProperty("lists") val lists: List<Lists> @JsonProperty("lists") @SerialName("lists") val lists: List<Lists>,
) )
@Serializable
data class Data( data class Data(
@JsonProperty("MediaListCollection") val mediaListCollection: MediaListCollection @JsonProperty("MediaListCollection") @SerialName("MediaListCollection") val mediaListCollection: MediaListCollection,
) )
private suspend fun getAniListAnimeListSmart(auth: AuthData): Array<Lists>? { private suspend fun getAniListAnimeListSmart(auth: AuthData): Array<Lists>? {
@ -672,7 +685,6 @@ class AniListApi : SyncAPI() {
private suspend fun getFullAniListList(auth: AuthData): FullAnilistList? { private suspend fun getFullAniListList(auth: AuthData): FullAnilistList? {
val userID = auth.user.id val userID = auth.user.id
val mediaType = "ANIME" val mediaType = "ANIME"
val query = """ val query = """
query (${'$'}userID: Int = $userID, ${'$'}MEDIA: MediaType = $mediaType) { query (${'$'}userID: Int = $userID, ${'$'}MEDIA: MediaType = $mediaType) {
MediaListCollection (userId: ${'$'}userID, type: ${'$'}MEDIA) { MediaListCollection (userId: ${'$'}userID, type: ${'$'}MEDIA) {
@ -714,7 +726,7 @@ class AniListApi : SyncAPI() {
} }
""" """
val text = postApi(auth.token, query) val text = postApi(auth.token, query)
return text?.toKotlinObject() return tryParseJson<FullAnilistList>(text)
} }
suspend fun toggleLike(auth: AuthData, id: Int): Boolean { suspend fun toggleLike(auth: AuthData, id: Int): Boolean {
@ -735,9 +747,20 @@ class AniListApi : SyncAPI() {
} }
/** Used to query a saved MediaItem on the list to get the id for removal */ /** Used to query a saved MediaItem on the list to get the id for removal */
data class MediaListItemRoot(@JsonProperty("data") val data: MediaListItem? = null) @Serializable
data class MediaListItem(@JsonProperty("MediaList") val mediaList: MediaListId? = null) data class MediaListItemRoot(
data class MediaListId(@JsonProperty("id") val id: Long? = null) @JsonProperty("data") @SerialName("data") val data: MediaListItem? = null,
)
@Serializable
data class MediaListItem(
@JsonProperty("MediaList") @SerialName("MediaList") val mediaList: MediaListId? = null,
)
@Serializable
data class MediaListId(
@JsonProperty("id") @SerialName("id") val id: Long? = null,
)
private suspend fun postDataAboutId( private suspend fun postDataAboutId(
auth: AuthData, auth: AuthData,
@ -747,7 +770,6 @@ class AniListApi : SyncAPI() {
progress: Int? progress: Int?
): Boolean { ): Boolean {
val userID = auth.user.id val userID = auth.user.id
val q = val q =
// Delete item if status type is None // Delete item if status type is None
if (type == AniListStatusType.None) { if (type == AniListStatusType.None) {
@ -839,305 +861,356 @@ class AniListApi : SyncAPI() {
return seasons.toList() return seasons.toList()
} }
@Serializable
data class SeasonResponse( data class SeasonResponse(
@JsonProperty("data") val data: SeasonData, @JsonProperty("data") @SerialName("data") val data: SeasonData,
) )
@Serializable
data class SeasonData( data class SeasonData(
@JsonProperty("Media") val media: SeasonMedia, @JsonProperty("Media") @SerialName("Media") val media: SeasonMedia,
) )
@Serializable
data class RecommendedMedia(
@JsonProperty("id") @SerialName("id") val id: Int?,
@JsonProperty("title") @SerialName("title") val title: MediaTitle?,
@JsonProperty("coverImage") @SerialName("coverImage") val coverImage: MediaCoverImage?,
)
@Serializable
data class CharacterMedia(
@JsonProperty("id") @SerialName("id") val id: Int?,
@JsonProperty("title") @SerialName("title") val title: MediaTitle?,
@JsonProperty("coverImage") @SerialName("coverImage") val coverImage: MediaCoverImage?,
)
@Serializable
data class SeasonMedia( data class SeasonMedia(
@JsonProperty("id") val id: Int?, @JsonProperty("id") @SerialName("id") val id: Int?,
@JsonProperty("title") val title: MediaTitle?, @JsonProperty("title") @SerialName("title") val title: MediaTitle?,
@JsonProperty("idMal") val idMal: Int?, @JsonProperty("idMal") @SerialName("idMal") val idMal: Int?,
@JsonProperty("format") val format: String?, @JsonProperty("format") @SerialName("format") val format: String?,
@JsonProperty("nextAiringEpisode") val nextAiringEpisode: SeasonNextAiringEpisode?, @JsonProperty("nextAiringEpisode") @SerialName("nextAiringEpisode") val nextAiringEpisode: SeasonNextAiringEpisode?,
@JsonProperty("relations") val relations: SeasonEdges?, @JsonProperty("relations") @SerialName("relations") val relations: SeasonEdges?,
@JsonProperty("coverImage") val coverImage: MediaCoverImage?, @JsonProperty("coverImage") @SerialName("coverImage") val coverImage: MediaCoverImage?,
@JsonProperty("duration") val duration: Int?, @JsonProperty("duration") @SerialName("duration") val duration: Int?,
@JsonProperty("episodes") val episodes: Int?, @JsonProperty("episodes") @SerialName("episodes") val episodes: Int?,
@JsonProperty("genres") val genres: List<String>?, @JsonProperty("genres") @SerialName("genres") val genres: List<String>?,
@JsonProperty("synonyms") val synonyms: List<String>?, @JsonProperty("synonyms") @SerialName("synonyms") val synonyms: List<String>?,
@JsonProperty("averageScore") val averageScore: Int?, @JsonProperty("averageScore") @SerialName("averageScore") val averageScore: Int?,
@JsonProperty("isAdult") val isAdult: Boolean?, @JsonProperty("isAdult") @SerialName("isAdult") val isAdult: Boolean?,
@JsonProperty("trailer") val trailer: MediaTrailer?, @JsonProperty("trailer") @SerialName("trailer") val trailer: MediaTrailer?,
@JsonProperty("description") val description: String?, @JsonProperty("description") @SerialName("description") val description: String?,
@JsonProperty("characters") val characters: CharacterConnection?, @JsonProperty("characters") @SerialName("characters") val characters: CharacterConnection?,
@JsonProperty("recommendations") val recommendations: RecommendationConnection?, @JsonProperty("recommendations") @SerialName("recommendations") val recommendations: RecommendationConnection?,
) )
@Serializable
data class RecommendationConnection( data class RecommendationConnection(
@JsonProperty("edges") val edges: List<RecommendationEdge> = emptyList(), @JsonProperty("edges") @SerialName("edges") val edges: List<RecommendationEdge> = emptyList(),
@JsonProperty("nodes") val nodes: List<Recommendation> = emptyList(), @JsonProperty("nodes") @SerialName("nodes") val nodes: List<Recommendation> = emptyList(),
//@JsonProperty("pageInfo") val pageInfo: PageInfo,
) )
@Serializable
data class RecommendationEdge( data class RecommendationEdge(
//@JsonProperty("rating") val rating: Int, @JsonProperty("node") @SerialName("node") val node: Recommendation,
@JsonProperty("node") val node: Recommendation,
) )
@Serializable
data class Recommendation( data class Recommendation(
val id: Long, @JsonProperty("mediaRecommendation") @SerialName("mediaRecommendation") val mediaRecommendation: RecommendedMedia?,
@JsonProperty("mediaRecommendation") val mediaRecommendation: SeasonMedia?,
) )
@Serializable
data class CharacterName( data class CharacterName(
@JsonProperty("name") val first: String?, @JsonProperty("name") @SerialName("name") val first: String?,
@JsonProperty("middle") val middle: String?, @JsonProperty("middle") @SerialName("middle") val middle: String?,
@JsonProperty("last") val last: String?, @JsonProperty("last") @SerialName("last") val last: String?,
@JsonProperty("full") val full: String?, @JsonProperty("full") @SerialName("full") val full: String?,
@JsonProperty("native") val native: String?, @JsonProperty("native") @SerialName("native") val native: String?,
@JsonProperty("alternative") val alternative: List<String>?, @JsonProperty("alternative") @SerialName("alternative") val alternative: List<String>?,
@JsonProperty("alternativeSpoiler") val alternativeSpoiler: List<String>?, @JsonProperty("alternativeSpoiler") @SerialName("alternativeSpoiler") val alternativeSpoiler: List<String>?,
@JsonProperty("userPreferred") val userPreferred: String?, @JsonProperty("userPreferred") @SerialName("userPreferred") val userPreferred: String?,
) )
@Serializable
data class CharacterImage( data class CharacterImage(
@JsonProperty("large") val large: String?, @JsonProperty("large") @SerialName("large") val large: String?,
@JsonProperty("medium") val medium: String?, @JsonProperty("medium") @SerialName("medium") val medium: String?,
) )
@Serializable
data class Character( data class Character(
@JsonProperty("name") val name: CharacterName?, @JsonProperty("name") @SerialName("name") val name: CharacterName?,
@JsonProperty("age") val age: String?, @JsonProperty("age") @SerialName("age") val age: String?,
@JsonProperty("image") val image: CharacterImage?, @JsonProperty("image") @SerialName("image") val image: CharacterImage?,
) )
@Serializable
data class CharacterEdge( data class CharacterEdge(
@JsonProperty("id") val id: Int?, @JsonProperty("id") @SerialName("id") val id: Int?,
/** /**
MAIN * MAIN - A primary character role in the media
A primary character role in the media * SUPPORTING - A supporting character role in the media
* BACKGROUND - A background character in the media
SUPPORTING
A supporting character role in the media
BACKGROUND
A background character in the media
*/ */
@JsonProperty("role") val role: String?, @JsonProperty("role") @SerialName("role") val role: String?,
@JsonProperty("name") val name: String?, @JsonProperty("name") @SerialName("name") val name: String?,
@JsonProperty("voiceActors") val voiceActors: List<Staff>?, @JsonProperty("voiceActors") @SerialName("voiceActors") val voiceActors: List<Staff>?,
@JsonProperty("favouriteOrder") val favouriteOrder: Int?, @JsonProperty("favouriteOrder") @SerialName("favouriteOrder") val favouriteOrder: Int?,
@JsonProperty("media") val media: List<SeasonMedia>?, @JsonProperty("media") @SerialName("media") val media: List<CharacterMedia>?,
@JsonProperty("node") val node: Character?, @JsonProperty("node") @SerialName("node") val node: Character?,
) )
@Serializable
data class StaffImage( data class StaffImage(
@JsonProperty("large") val large: String?, @JsonProperty("large") @SerialName("large") val large: String?,
@JsonProperty("medium") val medium: String?, @JsonProperty("medium") @SerialName("medium") val medium: String?,
) )
@Serializable
data class StaffName( data class StaffName(
@JsonProperty("name") val first: String?, @JsonProperty("name") @SerialName("name") val first: String?,
@JsonProperty("middle") val middle: String?, @JsonProperty("middle") @SerialName("middle") val middle: String?,
@JsonProperty("last") val last: String?, @JsonProperty("last") @SerialName("last") val last: String?,
@JsonProperty("full") val full: String?, @JsonProperty("full") @SerialName("full") val full: String?,
@JsonProperty("native") val native: String?, @JsonProperty("native") @SerialName("native") val native: String?,
@JsonProperty("alternative") val alternative: List<String>?, @JsonProperty("alternative") @SerialName("alternative") val alternative: List<String>?,
@JsonProperty("userPreferred") val userPreferred: String?, @JsonProperty("userPreferred") @SerialName("userPreferred") val userPreferred: String?,
) )
@Serializable
data class Staff( data class Staff(
@JsonProperty("image") val image: StaffImage?, @JsonProperty("image") @SerialName("image") val image: StaffImage?,
@JsonProperty("name") val name: StaffName?, @JsonProperty("name") @SerialName("name") val name: StaffName?,
@JsonProperty("age") val age: Int?, @JsonProperty("age") @SerialName("age") val age: Int?,
) )
@Serializable
data class CharacterConnection( data class CharacterConnection(
@JsonProperty("edges") val edges: List<CharacterEdge>?, @JsonProperty("edges") @SerialName("edges") val edges: List<CharacterEdge>?,
@JsonProperty("nodes") val nodes: List<Character>?, @JsonProperty("nodes") @SerialName("nodes") val nodes: List<Character>?,
//@JsonProperty("pageInfo") pageInfo: PageInfo
) )
@Serializable
data class MediaTrailer( data class MediaTrailer(
@JsonProperty("id") val id: String?, @JsonProperty("id") @SerialName("id") val id: String?,
@JsonProperty("site") val site: String?, @JsonProperty("site") @SerialName("site") val site: String?,
@JsonProperty("thumbnail") val thumbnail: String?, @JsonProperty("thumbnail") @SerialName("thumbnail") val thumbnail: String?,
) )
@Serializable
data class MediaCoverImage( data class MediaCoverImage(
@JsonProperty("extraLarge") val extraLarge: String?, @JsonProperty("extraLarge") @SerialName("extraLarge") val extraLarge: String?,
@JsonProperty("large") val large: String?, @JsonProperty("large") @SerialName("large") val large: String?,
@JsonProperty("medium") val medium: String?, @JsonProperty("medium") @SerialName("medium") val medium: String?,
@JsonProperty("color") val color: String?, @JsonProperty("color") @SerialName("color") val color: String?,
) )
@Serializable
data class SeasonNextAiringEpisode( data class SeasonNextAiringEpisode(
@JsonProperty("episode") val episode: Int?, @JsonProperty("episode") @SerialName("episode") val episode: Int?,
@JsonProperty("timeUntilAiring") val timeUntilAiring: Int?, @JsonProperty("timeUntilAiring") @SerialName("timeUntilAiring") val timeUntilAiring: Int?,
) )
@Serializable
data class SeasonEdges( data class SeasonEdges(
@JsonProperty("edges") val edges: List<SeasonEdge>?, @JsonProperty("edges") @SerialName("edges") val edges: List<SeasonEdge>?,
) )
@Serializable
data class SeasonEdge( data class SeasonEdge(
@JsonProperty("id") val id: Int?, @JsonProperty("id") @SerialName("id") val id: Int?,
@JsonProperty("relationType") val relationType: String?, @JsonProperty("relationType") @SerialName("relationType") val relationType: String?,
@JsonProperty("node") val node: SeasonNode?, @JsonProperty("node") @SerialName("node") val node: SeasonNode?,
) )
@Serializable
data class AniListFavoritesMediaConnection( data class AniListFavoritesMediaConnection(
@JsonProperty("nodes") val nodes: List<LikeNode>, @JsonProperty("nodes") @SerialName("nodes") val nodes: List<LikeNode>,
) )
@Serializable
data class AniListFavourites( data class AniListFavourites(
@JsonProperty("anime") val anime: AniListFavoritesMediaConnection, @JsonProperty("anime") @SerialName("anime") val anime: AniListFavoritesMediaConnection,
) )
@Serializable
data class MediaTitle( data class MediaTitle(
@JsonProperty("romaji") val romaji: String?, @JsonProperty("romaji") @SerialName("romaji") val romaji: String?,
@JsonProperty("english") val english: String?, @JsonProperty("english") @SerialName("english") val english: String?,
@JsonProperty("native") val native: String?, @JsonProperty("native") @SerialName("native") val native: String?,
@JsonProperty("userPreferred") val userPreferred: String?, @JsonProperty("userPreferred") @SerialName("userPreferred") val userPreferred: String?,
) )
@Serializable
data class SeasonNode( data class SeasonNode(
@JsonProperty("id") val id: Int, @JsonProperty("id") @SerialName("id") val id: Int,
@JsonProperty("format") val format: String?, @JsonProperty("format") @SerialName("format") val format: String?,
@JsonProperty("title") val title: Title?, @JsonProperty("title") @SerialName("title") val title: Title?,
@JsonProperty("idMal") val idMal: Int?, @JsonProperty("idMal") @SerialName("idMal") val idMal: Int?,
@JsonProperty("coverImage") val coverImage: CoverImage?, @JsonProperty("coverImage") @SerialName("coverImage") val coverImage: CoverImage?,
@JsonProperty("averageScore") val averageScore: Int? @JsonProperty("averageScore") @SerialName("averageScore") val averageScore: Int?,
// @JsonProperty("nextAiringEpisode") val nextAiringEpisode: SeasonNextAiringEpisode?,
) )
@Serializable
data class AniListAvatar( data class AniListAvatar(
@JsonProperty("large") val large: String?, @JsonProperty("large") @SerialName("large") val large: String?,
) )
@Serializable
data class AniListViewer( data class AniListViewer(
@JsonProperty("id") val id: Int, @JsonProperty("id") @SerialName("id") val id: Int,
@JsonProperty("name") val name: String, @JsonProperty("name") @SerialName("name") val name: String,
@JsonProperty("avatar") val avatar: AniListAvatar?, @JsonProperty("avatar") @SerialName("avatar") val avatar: AniListAvatar?,
@JsonProperty("favourites") val favourites: AniListFavourites?, @JsonProperty("favourites") @SerialName("favourites") val favourites: AniListFavourites?,
) )
@Serializable
data class AniListData( data class AniListData(
@JsonProperty("Viewer") val viewer: AniListViewer?, @JsonProperty("Viewer") @SerialName("Viewer") val viewer: AniListViewer?,
) )
@Serializable
data class AniListRoot( data class AniListRoot(
@JsonProperty("data") val data: AniListData?, @JsonProperty("data") @SerialName("data") val data: AniListData?,
) )
@Serializable
data class AniListUser( data class AniListUser(
@JsonProperty("id") val id: Int, @JsonProperty("id") @SerialName("id") val id: Int,
@JsonProperty("name") val name: String, @JsonProperty("name") @SerialName("name") val name: String,
@JsonProperty("picture") val picture: String?, @JsonProperty("picture") @SerialName("picture") val picture: String?,
) )
@Serializable
data class LikeNode( data class LikeNode(
@JsonProperty("id") val id: Int?, @JsonProperty("id") @SerialName("id") val id: Int?,
//@JsonProperty("idMal") public int idMal;
) )
@Serializable
data class LikePageInfo( data class LikePageInfo(
@JsonProperty("total") val total: Int?, @JsonProperty("total") @SerialName("total") val total: Int?,
@JsonProperty("currentPage") val currentPage: Int?, @JsonProperty("currentPage") @SerialName("currentPage") val currentPage: Int?,
@JsonProperty("lastPage") val lastPage: Int?, @JsonProperty("lastPage") @SerialName("lastPage") val lastPage: Int?,
@JsonProperty("perPage") val perPage: Int?, @JsonProperty("perPage") @SerialName("perPage") val perPage: Int?,
@JsonProperty("hasNextPage") val hasNextPage: Boolean?, @JsonProperty("hasNextPage") @SerialName("hasNextPage") val hasNextPage: Boolean?,
) )
@Serializable
data class LikeAnime( data class LikeAnime(
@JsonProperty("nodes") val nodes: List<LikeNode>?, @JsonProperty("nodes") @SerialName("nodes") val nodes: List<LikeNode>?,
@JsonProperty("pageInfo") val pageInfo: LikePageInfo?, @JsonProperty("pageInfo") @SerialName("pageInfo") val pageInfo: LikePageInfo?,
) )
@Serializable
data class LikeFavourites( data class LikeFavourites(
@JsonProperty("anime") val anime: LikeAnime?, @JsonProperty("anime") @SerialName("anime") val anime: LikeAnime?,
) )
@Serializable
data class LikeViewer( data class LikeViewer(
@JsonProperty("favourites") val favourites: LikeFavourites?, @JsonProperty("favourites") @SerialName("favourites") val favourites: LikeFavourites?,
) )
@Serializable
data class LikeData( data class LikeData(
@JsonProperty("Viewer") val viewer: LikeViewer?, @JsonProperty("Viewer") @SerialName("Viewer") val viewer: LikeViewer?,
) )
@Serializable
data class LikeRoot( data class LikeRoot(
@JsonProperty("data") val data: LikeData?, @JsonProperty("data") @SerialName("data") val data: LikeData?,
) )
@Serializable
data class AniListTitleHolder( data class AniListTitleHolder(
@JsonProperty("title") val title: Title?, @JsonProperty("title") @SerialName("title") val title: Title?,
@JsonProperty("isFavourite") val isFavourite: Boolean?, @JsonProperty("isFavourite") @SerialName("isFavourite") val isFavourite: Boolean?,
@JsonProperty("id") val id: Int?, @JsonProperty("id") @SerialName("id") val id: Int?,
@JsonProperty("progress") val progress: Int?, @JsonProperty("progress") @SerialName("progress") val progress: Int?,
@JsonProperty("episodes") val episodes: Int?, @JsonProperty("episodes") @SerialName("episodes") val episodes: Int?,
@JsonProperty("score") val score: Int?, @JsonProperty("score") @SerialName("score") val score: Int?,
@JsonProperty("type") val type: AniListStatusType?, @JsonProperty("type") @SerialName("type") val type: AniListStatusType?,
) )
@Serializable
data class GetDataMediaListEntry( data class GetDataMediaListEntry(
@JsonProperty("progress") val progress: Int?, @JsonProperty("progress") @SerialName("progress") val progress: Int?,
@JsonProperty("status") val status: String?, @JsonProperty("status") @SerialName("status") val status: String?,
@JsonProperty("score") val score: Int?, @JsonProperty("score") @SerialName("score") val score: Int?,
) )
@Serializable
data class Nodes( data class Nodes(
@JsonProperty("id") val id: Int?, @JsonProperty("id") @SerialName("id") val id: Int?,
@JsonProperty("mediaRecommendation") val mediaRecommendation: MediaRecommendation? @JsonProperty("mediaRecommendation") @SerialName("mediaRecommendation") val mediaRecommendation: MediaRecommendation?,
) )
@Serializable
data class GetDataMedia( data class GetDataMedia(
@JsonProperty("isFavourite") val isFavourite: Boolean?, @JsonProperty("isFavourite") @SerialName("isFavourite") val isFavourite: Boolean?,
@JsonProperty("episodes") val episodes: Int?, @JsonProperty("episodes") @SerialName("episodes") val episodes: Int?,
@JsonProperty("title") val title: Title?, @JsonProperty("title") @SerialName("title") val title: Title?,
@JsonProperty("mediaListEntry") val mediaListEntry: GetDataMediaListEntry? @JsonProperty("mediaListEntry") @SerialName("mediaListEntry") val mediaListEntry: GetDataMediaListEntry?,
) )
@Serializable
data class Recommendations( data class Recommendations(
@JsonProperty("nodes") val nodes: List<Nodes>? @JsonProperty("nodes") @SerialName("nodes") val nodes: List<Nodes>?,
) )
@Serializable
data class GetDataData( data class GetDataData(
@JsonProperty("Media") val media: GetDataMedia?, @JsonProperty("Media") @SerialName("Media") val media: GetDataMedia?,
) )
@Serializable
data class GetDataRoot( data class GetDataRoot(
@JsonProperty("data") val data: GetDataData?, @JsonProperty("data") @SerialName("data") val data: GetDataData?,
) )
@Serializable
data class GetSearchTitle( data class GetSearchTitle(
@JsonProperty("romaji") val romaji: String?, @JsonProperty("romaji") @SerialName("romaji") val romaji: String?,
) )
@Serializable
data class TrailerObject( data class TrailerObject(
@JsonProperty("id") val id: String?, @JsonProperty("id") @SerialName("id") val id: String?,
@JsonProperty("thumbnail") val thumbnail: String?, @JsonProperty("thumbnail") @SerialName("thumbnail") val thumbnail: String?,
@JsonProperty("site") val site: String?, @JsonProperty("site") @SerialName("site") val site: String?,
) )
@Serializable
data class GetSearchMedia( data class GetSearchMedia(
@JsonProperty("id") val id: Int, @JsonProperty("id") @SerialName("id") val id: Int,
@JsonProperty("idMal") val idMal: Int?, @JsonProperty("idMal") @SerialName("idMal") val idMal: Int?,
@JsonProperty("seasonYear") val seasonYear: Int, @JsonProperty("seasonYear") @SerialName("seasonYear") val seasonYear: Int,
@JsonProperty("title") val title: GetSearchTitle, @JsonProperty("title") @SerialName("title") val title: GetSearchTitle,
@JsonProperty("startDate") val startDate: StartedAt, @JsonProperty("startDate") @SerialName("startDate") val startDate: StartedAt,
@JsonProperty("averageScore") val averageScore: Int?, @JsonProperty("averageScore") @SerialName("averageScore") val averageScore: Int?,
@JsonProperty("meanScore") val meanScore: Int?, @JsonProperty("meanScore") @SerialName("meanScore") val meanScore: Int?,
@JsonProperty("bannerImage") val bannerImage: String?, @JsonProperty("bannerImage") @SerialName("bannerImage") val bannerImage: String?,
@JsonProperty("trailer") val trailer: TrailerObject?, @JsonProperty("trailer") @SerialName("trailer") val trailer: TrailerObject?,
@JsonProperty("nextAiringEpisode") val nextAiringEpisode: SeasonNextAiringEpisode?, @JsonProperty("nextAiringEpisode") @SerialName("nextAiringEpisode") val nextAiringEpisode: SeasonNextAiringEpisode?,
@JsonProperty("recommendations") val recommendations: Recommendations?, @JsonProperty("recommendations") @SerialName("recommendations") val recommendations: Recommendations?,
@JsonProperty("relations") val relations: SeasonEdges? @JsonProperty("relations") @SerialName("relations") val relations: SeasonEdges?,
) )
@Serializable
data class GetSearchPage( data class GetSearchPage(
@JsonProperty("Page") val page: GetSearchData?, @JsonProperty("Page") @SerialName("Page") val page: GetSearchData?,
) )
@Serializable
data class GetSearchData( data class GetSearchData(
@JsonProperty("media") val media: List<GetSearchMedia>?, @JsonProperty("media") @SerialName("media") val media: List<GetSearchMedia>?,
) )
@Serializable
data class GetSearchRoot( data class GetSearchRoot(
@JsonProperty("data") val data: GetSearchPage?, @JsonProperty("data") @SerialName("data") val data: GetSearchPage?,
) )
} }

View file

@ -7,11 +7,10 @@ import com.lagradost.cloudstream3.subtitles.AbstractSubtitleEntities
import com.lagradost.cloudstream3.subtitles.SubtitleResource import com.lagradost.cloudstream3.subtitles.SubtitleResource
import com.lagradost.cloudstream3.syncproviders.AuthData import com.lagradost.cloudstream3.syncproviders.AuthData
import com.lagradost.cloudstream3.syncproviders.SubtitleAPI import com.lagradost.cloudstream3.syncproviders.SubtitleAPI
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.lagradost.cloudstream3.utils.SubtitleHelper import com.lagradost.cloudstream3.utils.SubtitleHelper
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import java.util.concurrent.TimeUnit
class SubSourceApi : SubtitleAPI() { class SubSourceApi : SubtitleAPI() {
override val name = "SubSource" override val name = "SubSource"
@ -20,77 +19,70 @@ class SubSourceApi : SubtitleAPI() {
override val requiresLogin = false override val requiresLogin = false
companion object { companion object {
const val APIURL = "https://api.subsource.net/api" const val APIURL = "https://api.subsource.net/v1"
const val DOWNLOADENDPOINT = "https://api.subsource.net/api/downloadSub"
} }
override suspend fun search( override suspend fun search(
auth: AuthData?, auth: AuthData?,
query: AbstractSubtitleEntities.SubtitleSearch query: AbstractSubtitleEntities.SubtitleSearch
): List<AbstractSubtitleEntities.SubtitleEntity>? { ): List<AbstractSubtitleEntities.SubtitleEntity>? {
//Only supports Imdb Id search for now //Only supports Imdb Id search for now
if (query.imdbId == null) return null if (query.imdbId == null) return null
val queryLang = SubtitleHelper.fromTagToEnglishLanguageName(query.lang) val queryLang = SubtitleHelper.fromTagToEnglishLanguageName(query.lang)
val type = if ((query.seasonNumber ?: 0) > 0) TvType.TvSeries else TvType.Movie val type = if ((query.seasonNumber ?: 0) > 0) TvType.TvSeries else TvType.Movie
val searchRes = app.post( val searchResponse = app.post(
url = "$APIURL/searchMovie", url = "$APIURL/movie/search",
data = mapOf( json = mapOf(
"query" to query.imdbId!! "includeSeasons" to false,
) "limit" to 15,
).parsedSafe<ApiSearch>() ?: return null "query" to query.imdbId!!,
"signal" to "{}"
),
cacheTime = 120,
cacheUnit = TimeUnit.MINUTES,
).parsedSafe<SearchRoot>() ?: return null
val postData = if (type == TvType.TvSeries) { val firstResult = searchResponse.results.firstOrNull() ?: return null
mapOf(
"langs" to "[]", val apiResponse = app.get(
"movieName" to searchRes.found.first().linkName, url = "$APIURL${firstResult.link.replace("series", "subtitles")}",
"season" to "season-${query.seasonNumber}" cacheTime = 120,
) cacheUnit = TimeUnit.MINUTES,
} else { ).parsedSafe<ItemRoot>() ?: return null
mapOf(
"langs" to "[]", val filteredSubtitles = apiResponse.subtitles.filter { sub ->
"movieName" to searchRes.found.first().linkName, sub.releaseType != "trailer" &&
) sub.language.equals(queryLang, true)
} }
val getMovieRes = app.post(
url = "$APIURL/getMovie",
data = postData
).parsedSafe<ApiResponse>().let {
// api doesn't has episode number or lang filtering // api doesn't has episode number or lang filtering
if (type == TvType.Movie) { val subtitles = if (type == TvType.Movie) {
it?.subs?.filter { sub -> filteredSubtitles
sub.lang == queryLang
}
} else { } else {
it?.subs?.filter { sub -> val shouldContain = String.format(
sub.releaseName!!.contains(
String.format(
null, null,
"E%02d", "E%02d",
query.epNumber query.epNumber
) )
) && sub.lang == queryLang filteredSubtitles.filter { sub ->
sub.releaseInfo.contains(
shouldContain
)
} }
} }
} ?: return null
return getMovieRes.map { subtitle -> return subtitles.map { subtitle ->
AbstractSubtitleEntities.SubtitleEntity( AbstractSubtitleEntities.SubtitleEntity(
idPrefix = this.idPrefix, idPrefix = this.idPrefix,
name = subtitle.releaseName!!, name = subtitle.releaseInfo,
lang = subtitle.lang!!, lang = subtitle.language,
data = SubData( data = subtitle.link,
movie = subtitle.linkName!!,
lang = subtitle.lang,
id = subtitle.subId.toString(),
).toJson(),
type = type, type = type,
source = this.name, source = this.name,
epNumber = query.epNumber, epNumber = query.epNumber,
seasonNumber = query.seasonNumber, seasonNumber = query.seasonNumber,
isHearingImpaired = subtitle.hi == 1, isHearingImpaired = subtitle.hearingImpaired == 1,
) )
} }
} }
@ -99,79 +91,114 @@ class SubSourceApi : SubtitleAPI() {
auth: AuthData?, auth: AuthData?,
subtitle: AbstractSubtitleEntities.SubtitleEntity subtitle: AbstractSubtitleEntities.SubtitleEntity
) { ) {
val parsedSub = parseJson<SubData>(subtitle.data) val data = app.get("$APIURL/subtitle/${subtitle.data}")
.parsedSafe<DownloadRoot>()
val subRes = app.post( ?: return
url = "$APIURL/getSub",
data = mapOf(
"movie" to parsedSub.movie,
"lang" to subtitle.lang,
"id" to parsedSub.id
)
).parsedSafe<SubTitleLink>() ?: return
this.addZipUrl( this.addZipUrl(
"$DOWNLOADENDPOINT/${subRes.sub.downloadToken}" "$APIURL/subtitle/download/${data.subtitle.downloadToken}"
) { name, _ -> ) { name, _ ->
name name
} }
} }
@Serializable @Serializable
data class ApiSearch( data class SearchRoot(
@JsonProperty("success") @SerialName("success") val success: Boolean, @JsonProperty("success") @SerialName("success") var success: Boolean? = null,
@JsonProperty("found") @SerialName("found") val found: List<Found>, @JsonProperty("results") @SerialName("results") var results: ArrayList<Results> = arrayListOf(),
@JsonProperty("users") @SerialName("users") var users: ArrayList<Users> = arrayListOf()
) )
@Serializable @Serializable
data class Found( data class Users(
@JsonProperty("id") @SerialName("id") val id: Long,
@JsonProperty("title") @SerialName("title") val title: String, @JsonProperty("id") @SerialName("id") var id: Int? = null,
@JsonProperty("seasons") @SerialName("seasons") val seasons: Long, @JsonProperty("displayname") @SerialName("displayname") var displayname: String? = null,
@JsonProperty("type") @SerialName("type") val type: String, @JsonProperty("avatar") @SerialName("avatar") var avatar: String? = null,
@JsonProperty("releaseYear") @SerialName("releaseYear") val releaseYear: Long, @JsonProperty("badges") @SerialName("badges") var badges: ArrayList<String> = arrayListOf()
@JsonProperty("linkName") @SerialName("linkName") val linkName: String,
) )
@Serializable @Serializable
data class ApiResponse( data class Results(
@JsonProperty("success") @SerialName("success") val success: Boolean, @JsonProperty("id") @SerialName("id") var id: Int? = null,
@JsonProperty("movie") @SerialName("movie") val movie: Movie, @JsonProperty("title") @SerialName("title") var title: String? = null,
@JsonProperty("subs") @SerialName("subs") val subs: List<Sub>, @JsonProperty("type") @SerialName("type") var type: String? = null,
@JsonProperty("link") @SerialName("link") var link: String,
@JsonProperty("releaseYear") @SerialName("releaseYear") var releaseYear: Int? = null,
@JsonProperty("poster") @SerialName("poster") var poster: String? = null,
@JsonProperty("subtitleCount") @SerialName("subtitleCount") var subtitleCount: String? = null,
@JsonProperty("rating") @SerialName("rating") var rating: Double? = null,
@JsonProperty("cast") @SerialName("cast") var cast: ArrayList<String> = arrayListOf(),
@JsonProperty("genres") @SerialName("genres") var genres: ArrayList<String> = arrayListOf(),
@JsonProperty("score") @SerialName("score") var score: Double? = null
) )
@Serializable @Serializable
data class Movie(
@JsonProperty("id") @SerialName("id") val id: Long? = null, data class ItemRoot(
@JsonProperty("type") @SerialName("type") val type: String? = null,
@JsonProperty("year") @SerialName("year") val year: Long? = null, // @SerialName("media_type" ) var mediaType : String? = null,
@JsonProperty("fullName") @SerialName("fullName") val fullName: String? = null, @JsonProperty("subtitles") @SerialName("subtitles") var subtitles: ArrayList<Subtitles>,
//@SerialName("movie" ) var movie : Movie? = Movie()
) )
@Serializable @Serializable
data class Sub( data class Subtitles(
@JsonProperty("hi") @SerialName("hi") val hi: Int? = null,
@JsonProperty("fullLink") @SerialName("fullLink") val fullLink: String? = null, @JsonProperty("id") @SerialName("id") var id: Int? = null,
@JsonProperty("linkName") @SerialName("linkName") val linkName: String? = null, @JsonProperty("language") @SerialName("language") var language: String,
@JsonProperty("lang") @SerialName("lang") val lang: String? = null, @JsonProperty("release_type") @SerialName("release_type") var releaseType: String? = null,
@JsonProperty("releaseName") @SerialName("releaseName") val releaseName: String? = null, @JsonProperty("release_info") @SerialName("release_info") var releaseInfo: String,
@JsonProperty("subId") @SerialName("subId") val subId: Long? = null, @JsonProperty("upload_date") @SerialName("upload_date") var uploadDate: String? = null,
@JsonProperty("hearing_impaired") @SerialName("hearing_impaired") var hearingImpaired: Int? = null,
@JsonProperty("caption") @SerialName("caption") var caption: String? = null,
@JsonProperty("rating") @SerialName("rating") var rating: String? = null,
@JsonProperty("uploader_id") @SerialName("uploader_id") var uploaderId: Int? = null,
@JsonProperty("uploader_displayname") @SerialName("uploader_displayname") var uploaderDisplayname: String? = null,
@JsonProperty("uploader_badges") @SerialName("uploader_badges") var uploaderBadges: ArrayList<String> = arrayListOf(),
@JsonProperty("link") @SerialName("link") var link: String,
@JsonProperty("production_type") @SerialName("production_type") var productionType: String? = null,
@JsonProperty("last_subtitle") @SerialName("last_subtitle") var lastSubtitle: Boolean? = null
) )
@Serializable @Serializable
data class SubData( data class DownloadRoot(
@JsonProperty("movie") @SerialName("movie") val movie: String, @JsonProperty("subtitle") @SerialName("subtitle") var subtitle: Subtitle,
@JsonProperty("lang") @SerialName("lang") val lang: String, //@SerializedName("movie" ) var movie : Movie? = Movie(),
@JsonProperty("id") @SerialName("id") val id: String, //@SerializedName("donationLinks" ) var donationLinks : DonationLinks? = DonationLinks(),
//@SerializedName("isDownloaded" ) var isDownloaded : Boolean? = null,
//@SerializedName("user_rated" ) var userRated : String? = null
) )
@Serializable @Serializable
data class SubTitleLink( data class Subtitle(
@JsonProperty("sub") @SerialName("sub") val sub: SubToken,
) @JsonProperty("id") @SerialName("id") var id: Int? = null,
@JsonProperty("uploaded_at") @SerialName("uploaded_at") var uploadedAt: String? = null,
@JsonProperty("language") @SerialName("language") var language: String? = null,
@JsonProperty("rating") @SerialName("rating") var rating: String? = null,
//SerialName("rates" ) var rates : Rates? = Rates(),
@JsonProperty("uploaded_by") @SerialName("uploaded_by") var uploadedBy: Int? = null,
//@SerialName("contribs" ) var contribs : ArrayList<Contribs> = arrayListOf(),
@JsonProperty("release_info") @SerialName("release_info") var releaseInfo: ArrayList<String> = arrayListOf(),
@JsonProperty("commentary") @SerialName("commentary") var commentary: String? = null,
@JsonProperty("files") @SerialName("files") var files: String? = null,
@JsonProperty("size") @SerialName("size") var size: String? = null,
@JsonProperty("downloads") @SerialName("downloads") var downloads: Int? = null,
@JsonProperty("comments") @SerialName("comments") var comments: Int? = null,
@JsonProperty("production_type") @SerialName("production_type") var productionType: String? = null,
@JsonProperty("release_type") @SerialName("release_type") var releaseType: String? = null,
@JsonProperty("episode") @SerialName("episode") var episode: String? = null,
@JsonProperty("hearing_impaired") @SerialName("hearing_impaired") var hearingImpaired: Int? = null,
@JsonProperty("foreign_parts") @SerialName("foreign_parts") var foreignParts: String? = null,
@JsonProperty("framerate") @SerialName("framerate") var framerate: String? = null,
@JsonProperty("preview") @SerialName("preview") var preview: String? = null,
@JsonProperty("user_uploaded") @SerialName("user_uploaded") var userUploaded: Boolean? = null,
@JsonProperty("download_token") @SerialName("download_token") var downloadToken: String
@Serializable
data class SubToken(
@JsonProperty("downloadToken") @SerialName("downloadToken") val downloadToken: String,
) )
} }

View file

@ -12,6 +12,7 @@ import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.ListView import android.widget.ListView
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import com.fasterxml.jackson.annotation.JsonProperty
import com.google.android.gms.cast.MediaLoadOptions import com.google.android.gms.cast.MediaLoadOptions
import com.google.android.gms.cast.MediaQueueItem import com.google.android.gms.cast.MediaQueueItem
import com.google.android.gms.cast.MediaSeekOptions import com.google.android.gms.cast.MediaSeekOptions
@ -34,35 +35,24 @@ import com.lagradost.cloudstream3.ui.player.SubtitleData
import com.lagradost.cloudstream3.ui.result.ResultEpisode import com.lagradost.cloudstream3.ui.result.ResultEpisode
import com.lagradost.cloudstream3.ui.subtitles.ChromecastSubtitlesFragment import com.lagradost.cloudstream3.ui.subtitles.ChromecastSubtitlesFragment
import com.lagradost.cloudstream3.utils.AppContextUtils.sortSubs import com.lagradost.cloudstream3.utils.AppContextUtils.sortSubs
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.AppUtils.toJson import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.lagradost.cloudstream3.utils.CastHelper.awaitLinks import com.lagradost.cloudstream3.utils.CastHelper.awaitLinks
import com.lagradost.cloudstream3.utils.CastHelper.getMediaInfo import com.lagradost.cloudstream3.utils.CastHelper.getMediaInfo
import com.lagradost.cloudstream3.utils.Coroutines.ioSafe import com.lagradost.cloudstream3.utils.Coroutines.ioSafe
import com.lagradost.cloudstream3.utils.DataStore.toKotlinObject
import com.lagradost.cloudstream3.utils.DataStoreHelper import com.lagradost.cloudstream3.utils.DataStoreHelper
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.json.JSONObject import org.json.JSONObject
/*class SkipOpController(val view: ImageView) : UIController() {
init {
view.setImageResource(R.drawable.exo_controls_fastforward)
view.setOnClickListener {
remoteMediaClient?.let {
val options = MediaSeekOptions.Builder()
.setPosition(it.approximateStreamPosition + 85000)
it.seek(options.build())
}
}
}
}*/
private fun RemoteMediaClient.getItemIndex(): Int? { private fun RemoteMediaClient.getItemIndex(): Int? {
return try { return try {
val index = this.mediaQueue.itemIds.indexOf(this.currentItem?.itemId ?: 0) val index = this.mediaQueue.itemIds.indexOf(this.currentItem?.itemId ?: 0)
if (index < 0) null else index if (index < 0) null else index
} catch (e: Exception) { } catch (_: Exception) {
null null
} }
} }
@ -89,48 +79,41 @@ class SkipNextEpisodeController(val view: ImageView) : UIController() {
} }
} }
@Serializable
data class MetadataHolder( data class MetadataHolder(
val apiName: String, @JsonProperty("apiName") @SerialName("apiName") val apiName: String,
val isMovie: Boolean, @JsonProperty("isMovie") @SerialName("isMovie") val isMovie: Boolean,
val title: String?, @JsonProperty("title") @SerialName("title") val title: String?,
val poster: String?, @JsonProperty("poster") @SerialName("poster") val poster: String?,
val currentEpisodeIndex: Int, @JsonProperty("currentEpisodeIndex") @SerialName("currentEpisodeIndex") val currentEpisodeIndex: Int,
val episodes: List<ResultEpisode>, @JsonProperty("episodes") @SerialName("episodes") val episodes: List<ResultEpisode>,
val currentLinks: List<ExtractorLink>, @JsonProperty("currentLinks") @SerialName("currentLinks") val currentLinks: List<ExtractorLink>,
val currentSubtitles: List<SubtitleData> @JsonProperty("currentSubtitles") @SerialName("currentSubtitles") val currentSubtitles: List<SubtitleData>,
) )
class SelectSourceController(val view: ImageView, val activity: ControllerActivity) : class SelectSourceController(val view: ImageView, val activity: ControllerActivity) : UIController() {
UIController() {
init { init {
view.setImageResource(R.drawable.ic_baseline_playlist_play_24) view.setImageResource(R.drawable.ic_baseline_playlist_play_24)
view.setOnClickListener { view.setOnClickListener {
// lateinit var dialog: AlertDialog
val holder = getCurrentMetaData() val holder = getCurrentMetaData()
if (holder != null) { if (holder != null) {
val items = holder.currentLinks val items = holder.currentLinks
if (items.isNotEmpty() && remoteMediaClient?.currentItem != null) { if (items.isNotEmpty() && remoteMediaClient?.currentItem != null) {
val subTracks = val subTracks = remoteMediaClient?.mediaInfo?.mediaTracks?.filter { it.type == MediaTrack.TYPE_TEXT }
remoteMediaClient?.mediaInfo?.mediaTracks?.filter { it.type == MediaTrack.TYPE_TEXT }
?: ArrayList() ?: ArrayList()
val bottomSheetDialogBuilder = val bottomSheetDialogBuilder = AlertDialog.Builder(view.context, R.style.AlertDialogCustomBlack)
AlertDialog.Builder(view.context, R.style.AlertDialogCustomBlack)
bottomSheetDialogBuilder.setView(R.layout.sort_bottom_sheet) bottomSheetDialogBuilder.setView(R.layout.sort_bottom_sheet)
val bottomSheetDialog = bottomSheetDialogBuilder.create() val bottomSheetDialog = bottomSheetDialogBuilder.create()
bottomSheetDialog.show() bottomSheetDialog.show()
// bottomSheetDialog.setContentView(R.layout.sort_bottom_sheet)
val providerList = val providerList = bottomSheetDialog.findViewById<ListView>(R.id.sort_providers)!!
bottomSheetDialog.findViewById<ListView>(R.id.sort_providers)!! val subtitleList = bottomSheetDialog.findViewById<ListView>(R.id.sort_subtitles)!!
val subtitleList =
bottomSheetDialog.findViewById<ListView>(R.id.sort_subtitles)!!
if (subTracks.isEmpty()) { if (subTracks.isEmpty()) {
bottomSheetDialog.findViewById<LinearLayout>(R.id.sort_subtitles_holder)?.visibility = bottomSheetDialog.findViewById<LinearLayout>(R.id.sort_subtitles_holder)?.visibility = GONE
GONE
} else { } else {
val arrayAdapter = val arrayAdapter = ArrayAdapter<String>(view.context, R.layout.sort_bottom_single_choice)
ArrayAdapter<String>(view.context, R.layout.sort_bottom_single_choice)
arrayAdapter.add(view.context.getString(R.string.no_subtitles)) arrayAdapter.add(view.context.getString(R.string.no_subtitles))
arrayAdapter.addAll(subTracks.mapNotNull { it.name }) arrayAdapter.addAll(subTracks.mapNotNull { it.name })
@ -138,9 +121,7 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
subtitleList.adapter = arrayAdapter subtitleList.adapter = arrayAdapter
val currentTracks = remoteMediaClient?.mediaStatus?.activeTrackIds val currentTracks = remoteMediaClient?.mediaStatus?.activeTrackIds
val subtitleIndex = if (currentTracks == null) 0 else subTracks.map { it.id }
val subtitleIndex =
if (currentTracks == null) 0 else subTracks.map { it.id }
.indexOfFirst { currentTracks.contains(it) } + 1 .indexOfFirst { currentTracks.contains(it) } + 1
subtitleList.setSelection(subtitleIndex) subtitleList.setSelection(subtitleIndex)
@ -153,9 +134,7 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
ChromecastSubtitlesFragment.getCurrentSavedStyle().apply { ChromecastSubtitlesFragment.getCurrentSavedStyle().apply {
val font = TextTrackStyle() val font = TextTrackStyle()
font.setFontFamily(fontFamily ?: "Google Sans") font.setFontFamily(fontFamily ?: "Google Sans")
fontGenericFamily?.let { fontGenericFamily?.let { font.fontGenericFamily = it }
font.fontGenericFamily = it
}
font.windowColor = windowColor font.windowColor = windowColor
font.backgroundColor = backgroundColor font.backgroundColor = backgroundColor
@ -185,13 +164,11 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
val contentUrl = (remoteMediaClient?.currentItem?.media?.contentUrl val contentUrl = (remoteMediaClient?.currentItem?.media?.contentUrl
?: remoteMediaClient?.currentItem?.media?.contentId) ?: remoteMediaClient?.currentItem?.media?.contentId)
val sortingMethods = val sortingMethods = items.map { "${it.name} ${Qualities.getStringByInt(it.quality)}" }
items.map { "${it.name} ${Qualities.getStringByInt(it.quality)}" }
.toTypedArray() .toTypedArray()
val sotringIndex = items.indexOfFirst { it.url == contentUrl } val sotringIndex = items.indexOfFirst { it.url == contentUrl }
val arrayAdapter = val arrayAdapter = ArrayAdapter<String>(view.context, R.layout.sort_bottom_single_choice)
ArrayAdapter<String>(view.context, R.layout.sort_bottom_single_choice)
arrayAdapter.addAll(sortingMethods.toMutableList()) arrayAdapter.addAll(sortingMethods.toMutableList())
providerList.choiceMode = AbsListView.CHOICE_MODE_SINGLE providerList.choiceMode = AbsListView.CHOICE_MODE_SINGLE
@ -201,10 +178,8 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
providerList.setOnItemClickListener { _, _, which, _ -> providerList.setOnItemClickListener { _, _, which, _ ->
val epData = holder.episodes[holder.currentEpisodeIndex] val epData = holder.episodes[holder.currentEpisodeIndex]
fun loadMirror(index: Int) { fun loadMirror(index: Int) {
if (holder.currentLinks.size <= index) return if (holder.currentLinks.size <= index) return
val mediaItem = getMediaInfo( val mediaItem = getMediaInfo(
epData, epData,
holder, holder,
@ -214,25 +189,21 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
) )
val startAt = remoteMediaClient?.approximateStreamPosition ?: 0 val startAt = remoteMediaClient?.approximateStreamPosition ?: 0
//remoteMediaClient.load(mediaItem, true, startAt)
try { // THIS IS VERY IMPORTANT BECAUSE WE NEVER WANT TO AUTOLOAD THE NEXT EPISODE try { // THIS IS VERY IMPORTANT BECAUSE WE NEVER WANT TO AUTOLOAD THE NEXT EPISODE
val currentIdIndex = remoteMediaClient?.getItemIndex() val currentIdIndex = remoteMediaClient?.getItemIndex()
val nextId = remoteMediaClient?.mediaQueue?.itemIds?.get( val nextId = remoteMediaClient?.mediaQueue?.itemIds?.get(
currentIdIndex?.plus(1) ?: 0 currentIdIndex?.plus(1) ?: 0
) )
if (currentIdIndex == null && nextId != null) { if (currentIdIndex == null && nextId != null) {
awaitLinks( awaitLinks(
remoteMediaClient?.queueInsertAndPlayItem( remoteMediaClient?.queueInsertAndPlayItem(
MediaQueueItem.Builder(mediaItem).build(), MediaQueueItem.Builder(mediaItem).build(),
nextId, nextId,
startAt, startAt,
JSONObject() JSONObject(),
) )
) { ) { loadMirror(index + 1) }
loadMirror(index + 1)
}
} else { } else {
val mediaLoadOptions = val mediaLoadOptions =
MediaLoadOptions.Builder() MediaLoadOptions.Builder()
@ -244,11 +215,9 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
mediaItem, mediaItem,
mediaLoadOptions mediaLoadOptions
) )
) { ) { loadMirror(index + 1) }
loadMirror(index + 1)
} }
} } catch (_: Exception) {
} catch (e: Exception) {
val mediaLoadOptions = val mediaLoadOptions =
MediaLoadOptions.Builder() MediaLoadOptions.Builder()
.setPlayPosition(startAt) .setPlayPosition(startAt)
@ -259,8 +228,8 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
} }
} }
} }
loadMirror(which)
loadMirror(which)
bottomSheetDialog.dismissSafe(activity) bottomSheetDialog.dismissSafe(activity)
} }
} }
@ -270,23 +239,19 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
private fun getCurrentMetaData(): MetadataHolder? { private fun getCurrentMetaData(): MetadataHolder? {
return try { return try {
val data = remoteMediaClient?.mediaInfo?.customData?.toString() val data = remoteMediaClient?.mediaInfo?.customData?.toString() ?: return null
data?.toKotlinObject() parseJson<MetadataHolder>(data)
} catch (e: Exception) { } catch (_: Exception) {
null null
} }
} }
var isLoadingMore = false var isLoadingMore = false
override fun onMediaStatusUpdated() { override fun onMediaStatusUpdated() {
super.onMediaStatusUpdated() super.onMediaStatusUpdated()
val meta = getCurrentMetaData() val meta = getCurrentMetaData()
view.visibility = if ((meta?.currentLinks?.size ?: 0) > 1) VISIBLE else INVISIBLE
view.visibility = if ((meta?.currentLinks?.size
?: 0) > 1
) VISIBLE else INVISIBLE
try { try {
if (meta != null && meta.episodes.size > meta.currentEpisodeIndex + 1) { if (meta != null && meta.episodes.size > meta.currentEpisodeIndex + 1) {
val currentIdIndex = remoteMediaClient?.getItemIndex() ?: return val currentIdIndex = remoteMediaClient?.getItemIndex() ?: return
@ -303,7 +268,7 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
currentPosition, currentPosition,
currentDuration, currentDuration,
epData, epData,
meta.episodes.getOrNull(index + 1) meta.episodes.getOrNull(index + 1),
) )
} catch (t: Throwable) { } catch (t: Throwable) {
logError(t) logError(t)
@ -314,9 +279,7 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
ioSafe { ioSafe {
val currentLinks = mutableSetOf<ExtractorLink>() val currentLinks = mutableSetOf<ExtractorLink>()
val currentSubs = mutableSetOf<SubtitleData>() val currentSubs = mutableSetOf<SubtitleData>()
val generator = RepoLinkGenerator(listOf(epData)) val generator = RepoLinkGenerator(listOf(epData))
val isSuccessful = safeApiCall { val isSuccessful = safeApiCall {
generator.generateLinks( generator.generateLinks(
clearCache = false, clearCache = false,
@ -329,7 +292,7 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
currentSubs.add(it) currentSubs.add(it)
}, },
offset = 0, offset = 0,
isCasting = true isCasting = true,
) )
} }
@ -340,32 +303,18 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
val jsonCopy = meta.copy( val jsonCopy = meta.copy(
currentLinks = sortedLinks, currentLinks = sortedLinks,
currentSubtitles = sortedSubs, currentSubtitles = sortedSubs,
currentEpisodeIndex = index currentEpisodeIndex = index,
) )
val done = val done = JSONObject(jsonCopy.toJson())
JSONObject(jsonCopy.toJson())
val mediaInfo = getMediaInfo( val mediaInfo = getMediaInfo(
epData, epData,
jsonCopy, jsonCopy,
0, 0,
done, done,
sortedSubs sortedSubs,
) )
/*fun loadIndex(index: Int) {
println("LOAD INDEX::::: $index")
if (meta.currentLinks.size <= index) return
val info = getMediaInfo(
epData,
meta,
index,
done)
awaitLinks(remoteMediaClient?.load(info, true, 0)) {
loadIndex(index + 1)
}
}*/
activity.runOnUiThread { activity.runOnUiThread {
awaitLinks( awaitLinks(
remoteMediaClient?.queueAppendItem( remoteMediaClient?.queueAppendItem(
@ -374,7 +323,6 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
) )
) { ) {
println("FAILED TO LOAD NEXT ITEM") println("FAILED TO LOAD NEXT ITEM")
// loadIndex(1)
} }
isLoadingMore = false isLoadingMore = false
} }
@ -397,10 +345,7 @@ class SelectSourceController(val view: ImageView, val activity: ControllerActivi
class SkipTimeController(val view: ImageView, forwards: Boolean) : UIController() { class SkipTimeController(val view: ImageView, forwards: Boolean) : UIController() {
init { init {
//val settingsManager = PreferenceManager.getDefaultSharedPreferences()
//val time = settingsManager?.getInt("chromecast_tap_time", 30) ?: 30
val time = 30 val time = 30
//view.setImageResource(if (forwards) R.drawable.netflix_skip_forward else R.drawable.netflix_skip_back)
view.setImageResource(if (forwards) R.drawable.go_forward_30 else R.drawable.go_back_30) view.setImageResource(if (forwards) R.drawable.go_forward_30 else R.drawable.go_back_30)
view.setOnClickListener { view.setOnClickListener {
remoteMediaClient?.let { remoteMediaClient?.let {

View file

@ -37,8 +37,10 @@ import com.lagradost.cloudstream3.utils.DataStoreHelper
import com.lagradost.cloudstream3.utils.DataStoreHelper.getDefaultAccount import com.lagradost.cloudstream3.utils.DataStoreHelper.getDefaultAccount
import com.lagradost.cloudstream3.utils.ImageLoader.loadImage import com.lagradost.cloudstream3.utils.ImageLoader.loadImage
import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe
import com.lagradost.cloudstream3.utils.UIHelper.hideProgress
import com.lagradost.cloudstream3.utils.UIHelper.navigate import com.lagradost.cloudstream3.utils.UIHelper.navigate
import com.lagradost.cloudstream3.utils.UIHelper.showInputMethod import com.lagradost.cloudstream3.utils.UIHelper.showInputMethod
import com.lagradost.cloudstream3.utils.UIHelper.showProgress
object AccountHelper { object AccountHelper {
fun showAccountEditDialog( fun showAccountEditDialog(
@ -164,7 +166,7 @@ object AccountHelper {
canSetPin = true canSetPin = true
binding.editProfilePhotoButton.setOnClickListener({ binding.editProfilePhotoButton.setOnClickListener {
val bottomSheetDialog = BottomSheetDialog(context) val bottomSheetDialog = BottomSheetDialog(context)
val sheetBinding = BottomInputDialogBinding.inflate(LayoutInflater.from(context)) val sheetBinding = BottomInputDialogBinding.inflate(LayoutInflater.from(context))
bottomSheetDialog.setContentView(sheetBinding.root) bottomSheetDialog.setContentView(sheetBinding.root)
@ -174,9 +176,13 @@ object AccountHelper {
text1.text = context.getString(R.string.edit_profile_image_title) text1.text = context.getString(R.string.edit_profile_image_title)
nginxTextInput.hint = context.getString(R.string.edit_profile_image_hint) nginxTextInput.hint = context.getString(R.string.edit_profile_image_hint)
applyBtt.setOnClickListener({ applyBtt.setOnClickListener {
val url = sheetBinding.nginxTextInput.text.toString() val url = sheetBinding.nginxTextInput.text.toString()
if (url.isNotEmpty()) { if (url.isEmpty()) {
showToast(R.string.edit_profile_image_error_empty, Toast.LENGTH_SHORT)
return@setOnClickListener
}
applyBtt.showProgress()
val imageLoader = ImageLoader(context) val imageLoader = ImageLoader(context)
val request = ImageRequest.Builder(context) val request = ImageRequest.Builder(context)
.data(url) .data(url)
@ -189,27 +195,27 @@ object AccountHelper {
R.string.edit_profile_image_success, R.string.edit_profile_image_success,
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
) )
bottomSheetDialog.dismiss() bottomSheetDialog.dismissSafe()
}, },
onError = { _, _ -> onError = { _, _ ->
showToast( showToast(
R.string.edit_profile_image_error_invalid, R.string.edit_profile_image_error_invalid,
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
) )
applyBtt.hideProgress()
},
onCancel = {
applyBtt.hideProgress()
} }
) )
.build() .build()
imageLoader.enqueue(request) imageLoader.enqueue(request)
} else {
showToast(R.string.edit_profile_image_error_empty, Toast.LENGTH_SHORT)
} }
sheetBinding.cancelBtt.setOnClickListener {
bottomSheetDialog.dismissSafe() bottomSheetDialog.dismissSafe()
})
sheetBinding.cancelBtt.setOnClickListener({
bottomSheetDialog.dismissSafe()
})
} }
}) }
}
} }
fun showPinInputDialog( fun showPinInputDialog(

View file

@ -10,6 +10,7 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.lagradost.api.Log import com.lagradost.api.Log
import com.lagradost.cloudstream3.CloudStreamApp
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.isEpisodeBased import com.lagradost.cloudstream3.isEpisodeBased
import com.lagradost.cloudstream3.mvvm.Resource import com.lagradost.cloudstream3.mvvm.Resource
@ -36,6 +37,7 @@ import com.lagradost.cloudstream3.utils.ResourceLiveData
import com.lagradost.cloudstream3.utils.downloader.DownloadObjects import com.lagradost.cloudstream3.utils.downloader.DownloadObjects
import com.lagradost.cloudstream3.utils.downloader.DownloadQueueManager import com.lagradost.cloudstream3.utils.downloader.DownloadQueueManager
import com.lagradost.cloudstream3.utils.downloader.VideoDownloadManager.deleteFilesAndUpdateSettings import com.lagradost.cloudstream3.utils.downloader.VideoDownloadManager.deleteFilesAndUpdateSettings
import com.lagradost.cloudstream3.utils.downloader.VideoDownloadManager.downloadDeleteEvent
import com.lagradost.cloudstream3.utils.downloader.VideoDownloadManager.getDownloadFileInfo import com.lagradost.cloudstream3.utils.downloader.VideoDownloadManager.getDownloadFileInfo
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
@ -67,6 +69,17 @@ class DownloadViewModel : ViewModel() {
private val _selectedItemIds = ConsistentLiveData<Set<Int>?>(null) private val _selectedItemIds = ConsistentLiveData<Set<Int>?>(null)
val selectedItemIds: LiveData<Set<Int>?> = _selectedItemIds val selectedItemIds: LiveData<Set<Int>?> = _selectedItemIds
init {
// Keep the Downloads list in sync when a download is deleted/cancelled from
// anywhere in the app (result page button, queue, notification, etc.). See
// onDownloadDeleted for the rationale (issue #1227).
downloadDeleteEvent += ::onDownloadDeleted
}
override fun onCleared() {
downloadDeleteEvent -= ::onDownloadDeleted
super.onCleared()
}
fun cancelSelection() { fun cancelSelection() {
updateSelectedItems { null } updateSelectedItems { null }
@ -389,6 +402,18 @@ class DownloadViewModel : ViewModel() {
postChildren(_childCards.success?.filter { it.data.id !in idsToRemove }) postChildren(_childCards.success?.filter { it.data.id !in idsToRemove })
} }
/**
* Refreshes the Downloads screen in real time when a download is deleted/cancelled.
*/
private fun onDownloadDeleted(id: Int) {
// Keep multi-select state consistent: forget the removed id if it was selected.
updateSelectedItems { it?.minus(id) }
val context = CloudStreamApp.context ?: return
updateHeaderList(context)
postChildren(_childCards.success?.filterNot { it.data.id == id })
}
private fun updateStorageStats(visual: List<VisualDownloadCached.Header>) { private fun updateStorageStats(visual: List<VisualDownloadCached.Header>) {
try { try {
val stat = StatFs(Environment.getExternalStorageDirectory().path) val stat = StatFs(Environment.getExternalStorageDirectory().path)

View file

@ -164,9 +164,11 @@ abstract class BaseFetchButton(context: Context, attributeSet: AttributeSet) :
} }
} }
/*fun downloadDeleteEvent(data: Int) { fun downloadDeleteEvent(data: Int) {
if (data == persistentId) {
}*/ resetView()
}
}
/*fun downloadEvent(data: Pair<Int, VideoDownloadManager.DownloadActionType>) { /*fun downloadEvent(data: Pair<Int, VideoDownloadManager.DownloadActionType>) {
val (id, action) = data val (id, action) = data
@ -185,7 +187,7 @@ abstract class BaseFetchButton(context: Context, attributeSet: AttributeSet) :
override fun onAttachedToWindow() { override fun onAttachedToWindow() {
VideoDownloadManager.downloadStatusEvent += ::downloadStatusEvent VideoDownloadManager.downloadStatusEvent += ::downloadStatusEvent
// VideoDownloadManager.downloadDeleteEvent += ::downloadDeleteEvent VideoDownloadManager.downloadDeleteEvent += ::downloadDeleteEvent
// VideoDownloadManager.downloadEvent += ::downloadEvent // VideoDownloadManager.downloadEvent += ::downloadEvent
VideoDownloadManager.downloadProgressEvent += ::downloadProgressEvent VideoDownloadManager.downloadProgressEvent += ::downloadProgressEvent
@ -200,7 +202,7 @@ abstract class BaseFetchButton(context: Context, attributeSet: AttributeSet) :
override fun onDetachedFromWindow() { override fun onDetachedFromWindow() {
VideoDownloadManager.downloadStatusEvent -= ::downloadStatusEvent VideoDownloadManager.downloadStatusEvent -= ::downloadStatusEvent
// VideoDownloadManager.downloadDeleteEvent -= ::downloadDeleteEvent VideoDownloadManager.downloadDeleteEvent -= ::downloadDeleteEvent
// VideoDownloadManager.downloadEvent -= ::downloadEvent // VideoDownloadManager.downloadEvent -= ::downloadEvent
VideoDownloadManager.downloadProgressEvent -= ::downloadProgressEvent VideoDownloadManager.downloadProgressEvent -= ::downloadProgressEvent

View file

@ -24,6 +24,8 @@ import androidx.core.view.isVisible
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.lagradost.cloudstream3.plugins.PluginManager
import com.lagradost.cloudstream3.CloudStreamApp.Companion.getActivity
import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.chip.Chip import com.google.android.material.chip.Chip
@ -43,6 +45,7 @@ import com.lagradost.cloudstream3.mvvm.Resource
import com.lagradost.cloudstream3.mvvm.logError import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.mvvm.observe import com.lagradost.cloudstream3.mvvm.observe
import com.lagradost.cloudstream3.mvvm.observeNullable import com.lagradost.cloudstream3.mvvm.observeNullable
import com.lagradost.cloudstream3.plugins.Plugin
import com.lagradost.cloudstream3.ui.APIRepository.Companion.noneApi import com.lagradost.cloudstream3.ui.APIRepository.Companion.noneApi
import com.lagradost.cloudstream3.ui.APIRepository.Companion.randomApi import com.lagradost.cloudstream3.ui.APIRepository.Companion.randomApi
import com.lagradost.cloudstream3.ui.BaseFragment import com.lagradost.cloudstream3.ui.BaseFragment
@ -424,11 +427,30 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(
.inflate(R.layout.sort_bottom_single_provider_choice, parent, false) .inflate(R.layout.sort_bottom_single_provider_choice, parent, false)
val titleText = view.findViewById<TextView>(R.id.text1) val titleText = view.findViewById<TextView>(R.id.text1)
val pinIcon = view.findViewById<ImageView>(R.id.pinicon) val pinIcon = view.findViewById<ImageView>(R.id.pinicon)
val settingsIcon = view.findViewById<ImageView>(R.id.action_settings)
val name = getItem(position) val name = getItem(position)
titleText?.text = name titleText?.text = name
val providerApi = currentValidApis[position]
val isPinned = val isPinned =
pinnedphashset.contains(currentValidApis[position].name) pinnedphashset.contains(providerApi.name)
pinIcon.visibility = if (isPinned) View.VISIBLE else View.GONE pinIcon.visibility = if (isPinned) View.VISIBLE else View.GONE
val pluginInstance = providerApi.sourcePlugin?.let { PluginManager.plugins[it] } as? Plugin
val isDownloadedPluginWithSettings = pluginInstance?.openSettings != null && !isLayout(TV)
settingsIcon.visibility = if (isDownloadedPluginWithSettings) View.VISIBLE else View.GONE
if (isDownloadedPluginWithSettings) {
settingsIcon.setOnClickListener {
try {
val activityContext = it.context.getActivity() ?: it.context
pluginInstance.openSettings?.invoke(activityContext)
} catch (e: Throwable) {
logError(e)
}
}
}
return view return view
} }
} }
@ -451,7 +473,14 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(
arrayAdapter.clear() arrayAdapter.clear()
val sortedApis = validAPIs val sortedApis = validAPIs
.filter { .filter {
it.hasMainPage && (pinnedphashset.contains(it.name) || it.supportedTypes.any( val isPinned = pinnedphashset.contains(it.name)
// Hide pinned NSFW when NSFW not selected. NSFW is distracting when not chosen.
if (isPinned && !preSelectedTypes.contains(TvType.NSFW)) {
if (it.supportedTypes.all { type -> type == TvType.NSFW }) return@filter false
}
it.hasMainPage && (isPinned || it.supportedTypes.any(
preSelectedTypes::contains preSelectedTypes::contains
)) ))
} }
@ -665,7 +694,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(
fromUI = true fromUI = true
) )
showToast(R.string.action_reload, Toast.LENGTH_SHORT) showToast(R.string.action_reload, Toast.LENGTH_SHORT)
true
} }
homePreviewSearchButton.setOnClickListener { _ -> homePreviewSearchButton.setOnClickListener { _ ->
@ -673,6 +701,23 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(
homeViewModel.queryTextSubmit("") homeViewModel.queryTextSubmit("")
} }
// Load value for toggling Tv layout real time clock. Hide by default at startup
// set visibility first, to apply a scroll effect later
context?.let {
if (isLayout(TV)) {
val settingsManager = PreferenceManager.getDefaultSharedPreferences(it)
val toggleClock =
settingsManager.getBoolean(
getString(R.string.tv_layout_clock_key),
false
)
binding.homeClock.isVisible = toggleClock
} else {
binding.homeClock.isVisible = false
}
}
homeMasterRecycler.addOnScrollListener(object : RecyclerView.OnScrollListener() { homeMasterRecycler.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
if (isLayout(PHONE)) { if (isLayout(PHONE)) {
@ -712,6 +757,17 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(
view.getLocationInWindow(rect) view.getLocationInWindow(rect)
scrollParent.isVisible = true scrollParent.isVisible = true
scrollParent.translationY = rect[1].toFloat() - 60.toPx scrollParent.translationY = rect[1].toFloat() - 60.toPx
// Move the TV layout real time clock out of the way too
// We check if we have the correct layout and if the clock is enabled
if(isLayout(TV) && binding.homeClock.isVisible) {
val scrollParent = binding.homeClock
val rect = IntArray(2)
view.getLocationInWindow(rect)
scrollParent.isVisible = true
scrollParent.translationY = rect[1].toFloat() - 60.toPx
}
} }
} }
super.onScrolled(recyclerView, dx, dy) super.onScrolled(recyclerView, dx, dy)

View file

@ -58,7 +58,7 @@ class HomeScrollAdapter(
when (binding) { when (binding) {
is HomeScrollViewBinding -> { is HomeScrollViewBinding -> {
binding.homeScrollPreview.loadImage(posterUrl) binding.homeScrollPreview.loadImage(posterUrl, item.posterHeaders)
binding.homeScrollPreviewTags.apply { binding.homeScrollPreviewTags.apply {
text = item.tags?.joinToString("") ?: "" text = item.tags?.joinToString("") ?: ""
isGone = item.tags.isNullOrEmpty() isGone = item.tags.isNullOrEmpty()
@ -79,7 +79,7 @@ class HomeScrollAdapter(
binding.homeScrollPreview.setOnClickListener { view -> binding.homeScrollPreview.setOnClickListener { view ->
callback.invoke(view ?: return@setOnClickListener, position, item) callback.invoke(view ?: return@setOnClickListener, position, item)
} }
binding.homeScrollPreview.loadImage(posterUrl) binding.homeScrollPreview.loadImage(posterUrl, item.posterHeaders)
} }
} }
} }

View file

@ -20,6 +20,7 @@ import androidx.core.view.isVisible
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.fasterxml.jackson.annotation.JsonProperty
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator import com.google.android.material.tabs.TabLayoutMediator
import com.lagradost.cloudstream3.APIHolder import com.lagradost.cloudstream3.APIHolder
@ -52,12 +53,13 @@ import com.lagradost.cloudstream3.utils.DataStoreHelper.currentAccount
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialog import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialog
import com.lagradost.cloudstream3.utils.UIHelper.fixSystemBarsPadding import com.lagradost.cloudstream3.utils.UIHelper.fixSystemBarsPadding
import com.lagradost.cloudstream3.utils.UIHelper.getSpanCount import com.lagradost.cloudstream3.utils.UIHelper.getSpanCount
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.CopyOnWriteArrayList
import kotlin.math.abs import kotlin.math.abs
const val LIBRARY_FOLDER = "library_folder" const val LIBRARY_FOLDER = "library_folder"
enum class LibraryOpenerType(@StringRes val stringRes: Int) { enum class LibraryOpenerType(@StringRes val stringRes: Int) {
Default(R.string.action_default), Default(R.string.action_default),
Provider(R.string.none), Provider(R.string.none),
@ -67,13 +69,15 @@ enum class LibraryOpenerType(@StringRes val stringRes: Int) {
} }
/** Used to store how the user wants to open said poster */ /** Used to store how the user wants to open said poster */
@Serializable
data class LibraryOpener( data class LibraryOpener(
val openType: LibraryOpenerType, @JsonProperty("openType") @SerialName("openType") val openType: LibraryOpenerType,
val providerData: ProviderLibraryData?, @JsonProperty("providerData") @SerialName("providerData") val providerData: ProviderLibraryData?,
) )
@Serializable
data class ProviderLibraryData( data class ProviderLibraryData(
val apiName: String @JsonProperty("apiName") @SerialName("apiName") val apiName: String,
) )
class LibraryFragment : BaseFragment<FragmentLibraryBinding>( class LibraryFragment : BaseFragment<FragmentLibraryBinding>(

View file

@ -719,7 +719,7 @@ class CS3IPlayer : IPlayer {
**/ **/
var preferredAudioTrackLanguage: String? = null var preferredAudioTrackLanguage: String? = null
get() { get() {
return field ?: getKey( return field ?: getKey<String>(
"$currentAccount/$PREFERRED_AUDIO_LANGUAGE_KEY", "$currentAccount/$PREFERRED_AUDIO_LANGUAGE_KEY",
field field
)?.also { )?.also {

View file

@ -307,6 +307,7 @@ open class FullScreenPlayer : AbstractPlayerFragment<FragmentPlayerBinding>(
playerVideoTitleRez, playerVideoTitleRez,
playerVideoInfo, playerVideoInfo,
playerGoBackHolder, playerGoBackHolder,
playerVideoClock,
).forEach { ).forEach {
it.animateY(titleMove) it.animateY(titleMove)
} }
@ -772,7 +773,7 @@ open class FullScreenPlayer : AbstractPlayerFragment<FragmentPlayerBinding>(
val showPlayerEpisodes = !isGone && isThereEpisodes() val showPlayerEpisodes = !isGone && isThereEpisodes()
playerEpisodesButtonRoot.isVisible = showPlayerEpisodes playerEpisodesButtonRoot.isVisible = showPlayerEpisodes
playerEpisodesButton.isVisible = showPlayerEpisodes playerEpisodesButton.isVisible = showPlayerEpisodes
playerVideoTitleHolder.isGone = togglePlayerTitleGone playerVideoTitleHolder.isGone = togglePlayerTitleGone || playerVideoTitle.text.isBlank()
playerVideoTitleRez.isGone = isGone || playerVideoTitleRez.text.isBlank() playerVideoTitleRez.isGone = isGone || playerVideoTitleRez.text.isBlank()
playerEpisodeFiller.isGone = isGone playerEpisodeFiller.isGone = isGone
playerCenterMenu.isGone = isGone playerCenterMenu.isGone = isGone
@ -1202,6 +1203,10 @@ open class FullScreenPlayer : AbstractPlayerFragment<FragmentPlayerBinding>(
} }
skipChapterButton.setOnClickListener { skipChapterButton.setOnClickListener {
// Switch focus for a better UX, as otherwise it is reset to a random button like "back button"
if(skipChapterButton.hasFocus()) {
playerPausePlay.requestFocus()
}
player.handleEvent(CSPlayerEvent.SkipCurrentChapter) player.handleEvent(CSPlayerEvent.SkipCurrentChapter)
} }

View file

@ -8,6 +8,7 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.Typeface
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.text.Spanned import android.text.Spanned
@ -79,6 +80,7 @@ import com.lagradost.cloudstream3.ui.player.CS3IPlayer.Companion.preferredAudioT
import com.lagradost.cloudstream3.ui.player.CustomDecoder.Companion.updateForcedEncoding import com.lagradost.cloudstream3.ui.player.CustomDecoder.Companion.updateForcedEncoding
import com.lagradost.cloudstream3.ui.player.PlayerSubtitleHelper.Companion.toSubtitleMimeType import com.lagradost.cloudstream3.ui.player.PlayerSubtitleHelper.Companion.toSubtitleMimeType
import com.lagradost.cloudstream3.ui.player.source_priority.LinkSource import com.lagradost.cloudstream3.ui.player.source_priority.LinkSource
import com.lagradost.cloudstream3.ui.player.source_priority.ProfileSettings
import com.lagradost.cloudstream3.ui.player.source_priority.QualityDataHelper import com.lagradost.cloudstream3.ui.player.source_priority.QualityDataHelper
import com.lagradost.cloudstream3.ui.player.source_priority.QualityDataHelper.getLinkPriority import com.lagradost.cloudstream3.ui.player.source_priority.QualityDataHelper.getLinkPriority
import com.lagradost.cloudstream3.ui.player.source_priority.QualityProfileDialog import com.lagradost.cloudstream3.ui.player.source_priority.QualityProfileDialog
@ -117,8 +119,10 @@ import com.lagradost.cloudstream3.utils.UIHelper.clipboardHelper
import com.lagradost.cloudstream3.utils.UIHelper.colorFromAttribute import com.lagradost.cloudstream3.utils.UIHelper.colorFromAttribute
import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe
import com.lagradost.cloudstream3.utils.UIHelper.fixSystemBarsPadding import com.lagradost.cloudstream3.utils.UIHelper.fixSystemBarsPadding
import com.lagradost.cloudstream3.utils.UIHelper.hideProgress
import com.lagradost.cloudstream3.utils.UIHelper.hideSystemUI import com.lagradost.cloudstream3.utils.UIHelper.hideSystemUI
import com.lagradost.cloudstream3.utils.UIHelper.popCurrentPage import com.lagradost.cloudstream3.utils.UIHelper.popCurrentPage
import com.lagradost.cloudstream3.utils.UIHelper.showProgress
import com.lagradost.cloudstream3.utils.UIHelper.toPx import com.lagradost.cloudstream3.utils.UIHelper.toPx
import com.lagradost.cloudstream3.utils.downloader.DownloadUtils.getImageBitmapFromUrl import com.lagradost.cloudstream3.utils.downloader.DownloadUtils.getImageBitmapFromUrl
import com.lagradost.cloudstream3.utils.setText import com.lagradost.cloudstream3.utils.setText
@ -130,6 +134,7 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.io.Serializable import java.io.Serializable
import java.lang.ref.WeakReference
import java.util.Calendar import java.util.Calendar
import java.util.UUID import java.util.UUID
import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentHashMap
@ -507,7 +512,8 @@ class GeneratorPlayer : FullScreenPlayer() {
showDownloadProgress(DownloadEvent(0, 0, 0, null)) showDownloadProgress(DownloadEvent(0, 0, 0, null))
uiReset() // uiReset() // Removed due to UX
currentSelectedLink = link currentSelectedLink = link
// setEpisodes(viewModel.getAllMeta() ?: emptyList()) // setEpisodes(viewModel.getAllMeta() ?: emptyList())
setPlayerDimen(null) setPlayerDimen(null)
@ -790,11 +796,24 @@ class GeneratorPlayer : FullScreenPlayer() {
} }
binding.applyBtt.setOnClickListener { binding.applyBtt.setOnClickListener {
currentSubtitle?.let { currentSubtitle -> val currentSubtitle = currentSubtitle
providers.firstOrNull { it.idPrefix == currentSubtitle.idPrefix }?.let { api -> if (currentSubtitle == null) {
dialog.dismissSafe()
return@setOnClickListener
}
val api = providers.firstOrNull { it.idPrefix == currentSubtitle.idPrefix }
if (api == null) {
dialog.dismissSafe()
return@setOnClickListener
}
binding.applyBtt.showProgress()
ioSafe { ioSafe {
when (val apiResource = val apiResource =
Resource.fromResult(api.resource(currentSubtitle))) { Resource.fromResult(api.resource(currentSubtitle))
binding.applyBtt.hideProgress()
when (apiResource) {
is Resource.Success -> { is Resource.Success -> {
val subtitles = apiResource.value.getSubtitles().map { resource -> val subtitles = apiResource.value.getSubtitles().map { resource ->
SubtitleData( SubtitleData(
@ -814,6 +833,7 @@ class GeneratorPlayer : FullScreenPlayer() {
showToast(R.string.no_subtitles) showToast(R.string.no_subtitles)
return@ioSafe return@ioSafe
} }
dialog.dismissSafe()
runOnMainThread { runOnMainThread {
addAndSelectSubtitles(*subtitles.toTypedArray()) addAndSelectSubtitles(*subtitles.toTypedArray())
} }
@ -829,9 +849,6 @@ class GeneratorPlayer : FullScreenPlayer() {
} }
} }
} }
}
dialog.dismissSafe()
}
dialog.setOnDismissListener { dialog.setOnDismissListener {
dismissCallback.invoke() dismissCallback.invoke()
@ -1098,21 +1115,29 @@ class GeneratorPlayer : FullScreenPlayer() {
var sourceIndex = 0 var sourceIndex = 0
var startSource = 0 var startSource = 0
var sortedUrls = emptyList<Pair<ExtractorLink?, ExtractorUri?>>() // Filtered and sorted links
var currentHiddenFooter: View? = null
var filteredLinks: List<DisplayLink> = emptyList()
fun refreshLinks(qualityProfile: Int) { fun refreshLinks(qualityProfile: Int) {
sortedUrls = viewModel.state.sortLinks(qualityProfile) val currentLinkUsed = currentSelectedLink
if (sortedUrls.isEmpty()) { // Always display current linkFooter
val sortedLinks = viewModel.state.sortLinks(qualityProfile)
filteredLinks = sortedLinks.filter { it.shouldUseLink || it.link == currentLinkUsed }
if (sortedLinks.isEmpty()) {
sourceDialog.findViewById<LinearLayout>(R.id.sort_sources_holder)?.isGone = sourceDialog.findViewById<LinearLayout>(R.id.sort_sources_holder)?.isGone =
true true
} else { } else {
startSource = sortedUrls.indexOf(currentSelectedLink) startSource = filteredLinks.indexOfFirst { it.link == currentLinkUsed }
sourceIndex = startSource sourceIndex = startSource
val sourcesArrayAdapter = val sourcesArrayAdapter =
ArrayAdapter<String>(ctx, R.layout.sort_bottom_single_choice) ArrayAdapter<String>(ctx, R.layout.sort_bottom_single_choice)
sourcesArrayAdapter.addAll(sortedUrls.map { (link, uri) -> sourcesArrayAdapter.addAll(filteredLinks.map { displayLink ->
val (link, uri) = displayLink.link
val name = link?.name ?: uri?.name ?: "NULL" val name = link?.name ?: uri?.name ?: "NULL"
"$name ${Qualities.getStringByInt(link?.quality)}" "$name ${Qualities.getStringByInt(link?.quality)}"
}) })
@ -1128,7 +1153,7 @@ class GeneratorPlayer : FullScreenPlayer() {
} }
providerList.setOnItemLongClickListener { _, _, position, _ -> providerList.setOnItemLongClickListener { _, _, position, _ ->
sortedUrls.getOrNull(position)?.first?.url?.let { sortedLinks.getOrNull(position)?.link?.first?.url?.let {
clipboardHelper( clipboardHelper(
txt(R.string.video_source), txt(R.string.video_source),
it it
@ -1136,6 +1161,25 @@ class GeneratorPlayer : FullScreenPlayer() {
} }
true true
} }
val hiddenLinks = sortedLinks.size - filteredLinks.size
providerList.removeFooterView(currentHiddenFooter)
if (hiddenLinks > 0) {
val hiddenLinksFooter: TextView = layoutInflater.inflate(
R.layout.sort_bottom_footer_add_choice, null
) as TextView
providerList.addFooterView(hiddenLinksFooter, null, false)
currentHiddenFooter = hiddenLinksFooter
val hiddenLinksText =
ctx.resources.getQuantityString(R.plurals.links_hidden, hiddenLinks)
.format(hiddenLinks)
hiddenLinksFooter.text = hiddenLinksText
hiddenLinksFooter.setCompoundDrawables(null, null, null, null)
hiddenLinksFooter.setTypeface(null, Typeface.ITALIC)
}
} }
} }
@ -1349,8 +1393,8 @@ class GeneratorPlayer : FullScreenPlayer() {
} }
} }
if (init) { if (init) {
sortedUrls.getOrNull(sourceIndex)?.let { filteredLinks.getOrNull(sourceIndex)?.let {
loadLink(it, true) loadLink(it.link, true)
} }
} }
sourceDialog.dismissSafe(activity) sourceDialog.dismissSafe(activity)
@ -1518,6 +1562,10 @@ class GeneratorPlayer : FullScreenPlayer() {
} }
override fun playerError(exception: Throwable) { override fun playerError(exception: Throwable) {
currentSelectedLink?.let { link ->
viewModel.modifyState { this.addError(link) }
}
val currentUrl = val currentUrl =
currentSelectedLink?.let { it.first?.url ?: it.second?.uri?.toString() } ?: "unknown" currentSelectedLink?.let { it.first?.url ?: it.second?.uri?.toString() } ?: "unknown"
val headers = currentSelectedLink?.first?.headers?.toString() ?: "none" val headers = currentSelectedLink?.first?.headers?.toString() ?: "none"
@ -1525,7 +1573,7 @@ class GeneratorPlayer : FullScreenPlayer() {
Log.e( Log.e(
TAG, TAG,
"playerError: $currentSelectedLink, " + "playerError: $currentSelectedLink, " +
"type=${exception::class.java.canonicalName}, " + "type=${exception::class.qualifiedName}, " +
"message=${exception.message}, url=$currentUrl, headers=$headers, " + "message=${exception.message}, url=$currentUrl, headers=$headers, " +
"referer=$referer, position=${player.getPosition() ?: "unknown"}, " + "referer=$referer, position=${player.getPosition() ?: "unknown"}, " +
"duration=${player.getDuration() ?: "unknown"}, " + "duration=${player.getDuration() ?: "unknown"}, " +
@ -1540,8 +1588,22 @@ class GeneratorPlayer : FullScreenPlayer() {
private fun noLinksFound() { private fun noLinksFound() {
viewModel.forceClearCache = true viewModel.forceClearCache = true
val hiddenLinks = viewModel.state.sortLinks(currentQualityProfile).count { !it.shouldUseLink }
context?.let { ctx ->
// Display that there are hidden links to the user.
if (hiddenLinks > 0) {
val noLinksString = ctx.getString(R.string.no_links_found_toast)
val hiddenString =
ctx.resources.getQuantityString(R.plurals.links_hidden, hiddenLinks)
.format(hiddenLinks)
val toastText = "$noLinksString\n($hiddenString)"
showToast(toastText, Toast.LENGTH_SHORT)
} else {
showToast(R.string.no_links_found_toast, Toast.LENGTH_SHORT) showToast(R.string.no_links_found_toast, Toast.LENGTH_SHORT)
}
}
activity?.popCurrentPage() activity?.popCurrentPage()
} }
@ -1552,7 +1614,9 @@ class GeneratorPlayer : FullScreenPlayer() {
} }
val links = viewModel.state.sortLinks(currentQualityProfile) val links = viewModel.state.sortLinks(currentQualityProfile)
if (links.isEmpty()) {
val firstAvailableLink = links.firstOrNull { it.shouldUseLink }?.link
if (firstAvailableLink == null) {
noLinksFound() noLinksFound()
return return
} }
@ -1560,7 +1624,7 @@ class GeneratorPlayer : FullScreenPlayer() {
if (!isPlayerActive.compareAndSet(false, true)) { if (!isPlayerActive.compareAndSet(false, true)) {
return return
} }
loadLink(links.first(), false) loadLink(firstAvailableLink, false)
showPlayerMetadata() showPlayerMetadata()
} }
@ -1627,25 +1691,26 @@ class GeneratorPlayer : FullScreenPlayer() {
} }
} }
override fun hasNextMirror(): Boolean { private fun getNextLink(): DisplayLink? {
val links = viewModel.state.sortLinks(currentQualityProfile) val links = viewModel.state.sortLinks(currentQualityProfile)
return links.isNotEmpty() && links.indexOf(currentSelectedLink) + 1 < links.size val currentIndex = links.indexOfFirst { it.link == currentSelectedLink }
val nextPotentialLink =
links.withIndex().firstOrNull { it.index > currentIndex && it.value.shouldUseLink }
return nextPotentialLink?.value
}
override fun hasNextMirror(): Boolean {
return getNextLink() != null
} }
override fun nextMirror() { override fun nextMirror() {
val links = viewModel.state.sortLinks(currentQualityProfile) val nextLink = getNextLink()
if (links.isEmpty()) { if (nextLink == null) {
noLinksFound() noLinksFound()
return return
} }
val newIndex = links.indexOf(currentSelectedLink) + 1 loadLink(nextLink.link, true)
if (newIndex >= links.size) {
noLinksFound()
return
}
loadLink(links[newIndex], true)
} }
override fun onDestroy() { override fun onDestroy() {
@ -1698,10 +1763,12 @@ class GeneratorPlayer : FullScreenPlayer() {
if (settingsManager.getBoolean( if (settingsManager.getBoolean(
ctx.getString(R.string.episode_sync_enabled_key), true ctx.getString(R.string.episode_sync_enabled_key), true
) )
) maxEpisodeSet = meta.episode ) {
maxEpisodeSet = meta.episode
sync.modifyMaxEpisode(meta.totalEpisodeIndex ?: meta.episode) sync.modifyMaxEpisode(meta.totalEpisodeIndex ?: meta.episode)
} }
} }
}
if (meta.tvType.isAnimeOp()) isOpVisible = percentage < SKIP_OP_VIDEO_PERCENTAGE if (meta.tvType.isAnimeOp()) isOpVisible = percentage < SKIP_OP_VIDEO_PERCENTAGE
} }
@ -2150,6 +2217,7 @@ class GeneratorPlayer : FullScreenPlayer() {
isPlayerActive.set(false) isPlayerActive.set(false)
binding?.overlayLoadingSkipButton?.isVisible = false binding?.overlayLoadingSkipButton?.isVisible = false
binding?.playerLoadingOverlay?.isVisible = true binding?.playerLoadingOverlay?.isVisible = true
viewModel.modifyState { setError(emptyList()) }
uiReset() uiReset()
} }
@ -2203,6 +2271,14 @@ class GeneratorPlayer : FullScreenPlayer() {
fromTagToEnglishLanguageName(it)?.lowercase() ?: return@mapNotNull null fromTagToEnglishLanguageName(it)?.lowercase() ?: return@mapNotNull null
} ?: listOf() } ?: listOf()
} }
// Set up TV clock visibility
if (isLayout(TV)) {
val showTvClock = settingsManager.getBoolean(ctx.getString(R.string.tv_layout_clock_key), false)
playerBinding?.playerVideoClock?.isVisible = showTvClock
} else {
playerBinding?.playerVideoClock?.isVisible = false
}
} }
unwrapBundle(savedInstanceState) unwrapBundle(savedInstanceState)
@ -2281,19 +2357,23 @@ class GeneratorPlayer : FullScreenPlayer() {
} }
} }
observe(viewModel.currentLinks) { (links, instance) -> observe(viewModel.currentLinks) { (_, instance) ->
if (instance != viewModel.state.instance) return@observe // Outdated observe if (instance != viewModel.state.instance) return@observe // Outdated observe
val turnVisible = links.isNotEmpty() && viewModel.generator?.canSkipLoading == true val sortedLinks = viewModel.state.sortLinks(currentQualityProfile)
val usableLinks = sortedLinks.count { link -> link.shouldUseLink }
val turnVisible = usableLinks > 0 && viewModel.generator?.canSkipLoading == true
val wasGone = binding.overlayLoadingSkipButton.isGone val wasGone = binding.overlayLoadingSkipButton.isGone
binding.overlayLoadingSkipButton.apply { binding.overlayLoadingSkipButton.apply {
isVisible = turnVisible isVisible = turnVisible
if (links.isEmpty()) {
if (usableLinks == 0) {
setText(R.string.skip_loading) setText(R.string.skip_loading)
} else { } else {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
text = "${context.getString(R.string.skip_loading)} (${links.size})" text = "${context.getString(R.string.skip_loading)} (${usableLinks})"
} }
} }

View file

@ -10,6 +10,8 @@ import com.lagradost.cloudstream3.mvvm.Resource
import com.lagradost.cloudstream3.mvvm.launchSafe import com.lagradost.cloudstream3.mvvm.launchSafe
import com.lagradost.cloudstream3.mvvm.logError import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.mvvm.safeApiCall import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.ui.player.source_priority.ProfileSettings
import com.lagradost.cloudstream3.ui.player.source_priority.QualityDataHelper
import com.lagradost.cloudstream3.ui.player.source_priority.QualityDataHelper.getLinkPriority import com.lagradost.cloudstream3.ui.player.source_priority.QualityDataHelper.getLinkPriority
import com.lagradost.cloudstream3.ui.result.ResultEpisode import com.lagradost.cloudstream3.ui.result.ResultEpisode
import com.lagradost.cloudstream3.utils.Coroutines.ioSafe import com.lagradost.cloudstream3.utils.Coroutines.ioSafe
@ -40,12 +42,20 @@ data class GeneratorState(
val id: Int?, val id: Int?,
) )
data class DisplayLink(
val link: VideoLink,
// If the link should be displayed and used by the player
val shouldUseLink: Boolean,
val priority: Int
)
/** Immutable state of all current links relevant to displaying the video */ /** Immutable state of all current links relevant to displaying the video */
// @MustUseReturnValues // @MustUseReturnValues
// @Immutable // @Immutable
data class VideoState( data class VideoState(
val subtitles: PersistentSet<SubtitleData> = persistentSetOf(), val subtitles: PersistentSet<SubtitleData> = persistentSetOf(),
val links: PersistentSet<VideoLink> = persistentSetOf(), val links: PersistentSet<VideoLink> = persistentSetOf(),
val erroredLinks: PersistentSet<VideoLink> = persistentSetOf(),
val stamps: PersistentList<VideoSkipStamp> = persistentListOf(), val stamps: PersistentList<VideoSkipStamp> = persistentListOf(),
val loading: Resource<Unit> = Resource.Loading(), val loading: Resource<Unit> = Resource.Loading(),
val generatorState: GeneratorState? = null, val generatorState: GeneratorState? = null,
@ -56,19 +66,52 @@ data class VideoState(
* *
* sortedBy is not exactly expensive, but each hasNextMirror does it again, so this alleviates unnecessary recomputation * sortedBy is not exactly expensive, but each hasNextMirror does it again, so this alleviates unnecessary recomputation
* */ * */
private val sortedLinks: ConcurrentHashMap<Int, List<VideoLink>> = ConcurrentHashMap() private val sortedLinks: ConcurrentHashMap<Int, List<DisplayLink>> = ConcurrentHashMap()
/**
* The cache is guaranteed to be up to date link-wise due to the immutable links.
* However, hideNegativeSources and hideErrorSources could be updated, which requires clearing the cache.
*/
fun clearSortedLinksCache() = sortedLinks.clear() fun clearSortedLinksCache() = sortedLinks.clear()
private fun hasLinkErrored(link: VideoLink): Boolean {
return erroredLinks.any { it == link }
}
private fun VideoLink.toDisplayLink(
qualityProfile: Int,
hideNegativeSources: Boolean,
hideErrorSources: Boolean
): DisplayLink {
val priority = getLinkPriority(qualityProfile, this.first)
val shouldHideLink =
(hideNegativeSources && priority < 0) || (hideErrorSources && hasLinkErrored(this))
val displayLink = DisplayLink(this, !shouldHideLink, priority)
return displayLink
}
// Modifying sortedLinks is not considered a "visible" side effect, and rerunning it does not change the result // Modifying sortedLinks is not considered a "visible" side effect, and rerunning it does not change the result
// It is by all standards, idempotent and by extension also pure as it has no "visible" side effect // It is by all standards, idempotent and by extension also pure as it has no "visible" side effect
/** Returns .links in the sorted order according to the qualityProfile. /** Returns .links in the sorted order according to the qualityProfile.
* Use .links if order is not needed */ * Use .links if order is not needed */
@Contract(pure = true) @Contract(pure = true)
fun sortLinks(qualityProfile: Int): List<VideoLink> { fun sortLinks(qualityProfile: Int): List<DisplayLink> {
return sortedLinks[qualityProfile] ?: links.sortedBy { link -> sortedLinks[qualityProfile]?.let {
return it
}
val hideNegativeSources =
QualityDataHelper.getProfileSetting(qualityProfile, ProfileSettings.HideNegativeSources)
val hideErrorSources =
QualityDataHelper.getProfileSetting(qualityProfile, ProfileSettings.HideErrorSources)
return links.map { link ->
// negative because we want to sort highest quality first // negative because we want to sort highest quality first
-getLinkPriority(qualityProfile, link.first) link.toDisplayLink(qualityProfile, hideNegativeSources, hideErrorSources)
}.sortedBy {
// negative because we want to sort highest quality first
-it.priority
}.also { value -> sortedLinks[qualityProfile] = value } }.also { value -> sortedLinks[qualityProfile] = value }
} }
@ -113,6 +156,12 @@ data class VideoState(
@JvmName("setVideoSkipStamp") @JvmName("setVideoSkipStamp")
@Contract(pure = true) @Contract(pure = true)
fun set(items: Collection<VideoSkipStamp>): VideoState = copy(stamps = items.toPersistentList()) fun set(items: Collection<VideoSkipStamp>): VideoState = copy(stamps = items.toPersistentList())
@Contract(pure = true)
fun addError(item: VideoLink): VideoState = copy(erroredLinks = erroredLinks.add(item))
@Contract(pure = true)
fun setError(items: Collection<VideoLink>): VideoState = copy(erroredLinks = items.toPersistentSet())
} }
data class VideoLive<T>( data class VideoLive<T>(
@ -141,9 +190,8 @@ class PlayerGeneratorViewModel : ViewModel() {
var state = VideoState(instance = 0) var state = VideoState(instance = 0)
private set private set
private val _currentLinks = private val _currentLinks = MutableLiveData<VideoLive<Set<VideoLink>>>(null)
MutableLiveData<VideoLive<Set<Pair<ExtractorLink?, ExtractorUri?>>>>(null) val currentLinks: LiveData<VideoLive<Set<VideoLink>>> = _currentLinks
val currentLinks: LiveData<VideoLive<Set<Pair<ExtractorLink?, ExtractorUri?>>>> = _currentLinks
private val _currentSubtitles = MutableLiveData<VideoLive<Set<SubtitleData>>>(null) private val _currentSubtitles = MutableLiveData<VideoLive<Set<SubtitleData>>>(null)
val currentSubtitles: LiveData<VideoLive<Set<SubtitleData>>> = _currentSubtitles val currentSubtitles: LiveData<VideoLive<Set<SubtitleData>>> = _currentSubtitles

View file

@ -8,11 +8,14 @@ import androidx.annotation.OptIn
import androidx.media3.common.MimeTypes import androidx.media3.common.MimeTypes
import androidx.media3.common.util.UnstableApi import androidx.media3.common.util.UnstableApi
import androidx.media3.ui.SubtitleView import androidx.media3.ui.SubtitleView
import com.fasterxml.jackson.annotation.JsonIgnore
import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.ui.subtitles.SaveCaptionStyle import com.lagradost.cloudstream3.ui.subtitles.SaveCaptionStyle
import com.lagradost.cloudstream3.ui.subtitles.SubtitlesFragment.Companion.setSubtitleViewStyle import com.lagradost.cloudstream3.ui.subtitles.SubtitlesFragment.Companion.setSubtitleViewStyle
import com.lagradost.cloudstream3.utils.SubtitleHelper.fromLanguageToTagIETF import com.lagradost.cloudstream3.utils.SubtitleHelper.fromLanguageToTagIETF
import com.lagradost.cloudstream3.utils.UIHelper.toPx import com.lagradost.cloudstream3.utils.UIHelper.toPx
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
enum class SubtitleStatus { enum class SubtitleStatus {
IS_ACTIVE, IS_ACTIVE,
@ -32,17 +35,19 @@ enum class SubtitleOrigin {
* @param url Url for the subtitle, when EMBEDDED_IN_VIDEO this variable is used as the real backend id * @param url Url for the subtitle, when EMBEDDED_IN_VIDEO this variable is used as the real backend id
* @param headers if empty it will use the base onlineDataSource headers else only the specified headers * @param headers if empty it will use the base onlineDataSource headers else only the specified headers
* @param languageCode usually, tags such as "en", "es-mx", or "zh-hant-TW". But it could be something like "English 4" * @param languageCode usually, tags such as "en", "es-mx", or "zh-hant-TW". But it could be something like "English 4"
* */ */
@Serializable
data class SubtitleData( data class SubtitleData(
val originalName: String, @SerialName("originalName") val originalName: String,
val nameSuffix: String, @SerialName("nameSuffix") val nameSuffix: String,
val url: String, @SerialName("url") val url: String,
val origin: SubtitleOrigin, @SerialName("origin") val origin: SubtitleOrigin,
val mimeType: String, @SerialName("mimeType") val mimeType: String,
val headers: Map<String, String>, @SerialName("headers") val headers: Map<String, String>,
val languageCode: String?, @SerialName("languageCode") val languageCode: String?,
) { ) {
/** Internal ID for exoplayer, unique for each link*/ /** Internal ID for media3, unique for each link. */
@JsonIgnore
fun getId(): String { fun getId(): String {
return if (origin == SubtitleOrigin.EMBEDDED_IN_VIDEO) url return if (origin == SubtitleOrigin.EMBEDDED_IN_VIDEO) url
else "$url|$name" else "$url|$name"
@ -54,22 +59,22 @@ data class SubtitleData(
} }
/** Tries hard to figure out a valid IETF tag based on language code and name. Will return null if not found. */ /** Tries hard to figure out a valid IETF tag based on language code and name. Will return null if not found. */
@JsonIgnore
fun getIETF_tag(): String? { fun getIETF_tag(): String? {
return fromLanguageToTagIETF(this.languageCode) ?: fromLanguageToTagIETF(this.originalName, halfMatch = true) return fromLanguageToTagIETF(this.languageCode) ?: fromLanguageToTagIETF(this.originalName, halfMatch = true)
} }
val name = "$originalName $nameSuffix" @SerialName("name") val name = "$originalName $nameSuffix"
/** /**
* Gets the URL, but tries to fix it if it is malformed. * Gets the URL, but tries to fix it if it is malformed.
*/ */
@JsonIgnore
fun getFixedUrl(): String { fun getFixedUrl(): String {
// Some extensions fail to include the protocol, this helps with that. // Some extensions fail to include the protocol, this helps with that.
val fixedSubUrl = if (this.url.startsWith("//")) { val fixedSubUrl = if (this.url.startsWith("//")) {
"https:${this.url}" "https:${this.url}"
} else { } else this.url
this.url
}
return fixedSubUrl return fixedSubUrl
} }
} }

View file

@ -9,6 +9,8 @@ import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.ExtractorLinkType import com.lagradost.cloudstream3.utils.ExtractorLinkType
import com.lagradost.cloudstream3.utils.newExtractorLink import com.lagradost.cloudstream3.utils.newExtractorLink
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import torrServer.TorrServer import torrServer.TorrServer
import java.io.File import java.io.File
import java.net.ConnectException import java.net.ConnectException
@ -39,7 +41,7 @@ object Torrent {
app.get( app.get(
"$TORRENT_SERVER_URL/echo", "$TORRENT_SERVER_URL/echo",
).text.isNotEmpty() ).text.isNotEmpty()
} catch (e: ConnectException) { } catch (_: ConnectException) {
// `Failed to connect to /127.0.0.1:8090` if the server is down // `Failed to connect to /127.0.0.1:8090` if the server is down
false false
} catch (t: Throwable) { } catch (t: Throwable) {
@ -164,9 +166,7 @@ object Torrent {
/** Gets all the metadata of a torrent, will throw if that hash does not exists /** Gets all the metadata of a torrent, will throw if that hash does not exists
* https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/c18f58e51b6738f053261bc863177078aa9c1c98/web/api/torrents.go#L126 */ * https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/c18f58e51b6738f053261bc863177078aa9c1c98/web/api/torrents.go#L126 */
@Throws @Throws
suspend fun get( suspend fun get(hash: String): TorrentStatus {
hash: String,
): TorrentStatus {
if (TORRENT_SERVER_URL.isEmpty()) { if (TORRENT_SERVER_URL.isEmpty()) {
throw ErrorLoadingException("Not initialized") throw ErrorLoadingException("Not initialized")
} }
@ -278,94 +278,55 @@ object Torrent {
// https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/c18f58e51b6738f053261bc863177078aa9c1c98/web/api/torrents.go#L18 // https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/c18f58e51b6738f053261bc863177078aa9c1c98/web/api/torrents.go#L18
// https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/main/web/api/route.go#L7 // https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/main/web/api/route.go#L7
@Serializable
data class TorrentRequest( data class TorrentRequest(
@JsonProperty("action") @JsonProperty("action") @SerialName("action") val action: String,
val action: String, @JsonProperty("hash") @SerialName("hash") val hash: String = "",
@JsonProperty("hash") @JsonProperty("link") @SerialName("link") val link: String = "",
val hash: String = "", @JsonProperty("title") @SerialName("title") val title: String = "",
@JsonProperty("link") @JsonProperty("poster") @SerialName("poster") val poster: String = "",
val link: String = "", @JsonProperty("data") @SerialName("data") val data: String = "",
@JsonProperty("title") @JsonProperty("save_to_db") @SerialName("save_to_db") val saveToDB: Boolean = false,
val title: String = "",
@JsonProperty("poster")
val poster: String = "",
@JsonProperty("data")
val data: String = "",
@JsonProperty("save_to_db")
val saveToDB: Boolean = false,
) )
// https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/c18f58e51b6738f053261bc863177078aa9c1c98/torr/state/state.go#L33 // https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/c18f58e51b6738f053261bc863177078aa9c1c98/torr/state/state.go#L33
// omitempty = nullable // omitempty = nullable
@Serializable
data class TorrentStatus( data class TorrentStatus(
@JsonProperty("title") @JsonProperty("title") @SerialName("title") var title: String,
var title: String, @JsonProperty("poster") @SerialName("poster") var poster: String,
@JsonProperty("poster") @JsonProperty("data") @SerialName("data") var data: String?,
var poster: String, @JsonProperty("timestamp") @SerialName("timestamp") var timestamp: Long,
@JsonProperty("data") @JsonProperty("name") @SerialName("name") var name: String?,
var data: String?, @JsonProperty("hash") @SerialName("hash") var hash: String?,
@JsonProperty("timestamp") @JsonProperty("stat") @SerialName("stat") var stat: Int,
var timestamp: Long, @JsonProperty("stat_string") @SerialName("stat_string") var statString: String,
@JsonProperty("name") @JsonProperty("loaded_size") @SerialName("loaded_size") var loadedSize: Long?,
var name: String?, @JsonProperty("torrent_size") @SerialName("torrent_size") var torrentSize: Long?,
@JsonProperty("hash") @JsonProperty("preloaded_bytes") @SerialName("preloaded_bytes") var preloadedBytes: Long?,
var hash: String?, @JsonProperty("preload_size") @SerialName("preload_size") var preloadSize: Long?,
@JsonProperty("stat") @JsonProperty("download_speed") @SerialName("download_speed") var downloadSpeed: Double?,
var stat: Int, @JsonProperty("upload_speed") @SerialName("upload_speed") var uploadSpeed: Double?,
@JsonProperty("stat_string") @JsonProperty("total_peers") @SerialName("total_peers") var totalPeers: Int?,
var statString: String, @JsonProperty("pending_peers") @SerialName("pending_peers") var pendingPeers: Int?,
@JsonProperty("loaded_size") @JsonProperty("active_peers") @SerialName("active_peers") var activePeers: Int?,
var loadedSize: Long?, @JsonProperty("connected_seeders") @SerialName("connected_seeders") var connectedSeeders: Int?,
@JsonProperty("torrent_size") @JsonProperty("half_open_peers") @SerialName("half_open_peers") var halfOpenPeers: Int?,
var torrentSize: Long?, @JsonProperty("bytes_written") @SerialName("bytes_written") var bytesWritten: Long?,
@JsonProperty("preloaded_bytes") @JsonProperty("bytes_written_data") @SerialName("bytes_written_data") var bytesWrittenData: Long?,
var preloadedBytes: Long?, @JsonProperty("bytes_read") @SerialName("bytes_read") var bytesRead: Long?,
@JsonProperty("preload_size") @JsonProperty("bytes_read_data") @SerialName("bytes_read_data") var bytesReadData: Long?,
var preloadSize: Long?, @JsonProperty("bytes_read_useful_data") @SerialName("bytes_read_useful_data") var bytesReadUsefulData: Long?,
@JsonProperty("download_speed") @JsonProperty("chunks_written") @SerialName("chunks_written") var chunksWritten: Long?,
var downloadSpeed: Double?, @JsonProperty("chunks_read") @SerialName("chunks_read") var chunksRead: Long?,
@JsonProperty("upload_speed") @JsonProperty("chunks_read_useful") @SerialName("chunks_read_useful") var chunksReadUseful: Long?,
var uploadSpeed: Double?, @JsonProperty("chunks_read_wasted") @SerialName("chunks_read_wasted") var chunksReadWasted: Long?,
@JsonProperty("total_peers") @JsonProperty("pieces_dirtied_good") @SerialName("pieces_dirtied_good") var piecesDirtiedGood: Long?,
var totalPeers: Int?, @JsonProperty("pieces_dirtied_bad") @SerialName("pieces_dirtied_bad") var piecesDirtiedBad: Long?,
@JsonProperty("pending_peers") @JsonProperty("duration_seconds") @SerialName("duration_seconds") var durationSeconds: Double?,
var pendingPeers: Int?, @JsonProperty("bit_rate") @SerialName("bit_rate") var bitRate: String?,
@JsonProperty("active_peers") @JsonProperty("file_stats") @SerialName("file_stats") var fileStats: List<TorrentFileStat>?,
var activePeers: Int?, @JsonProperty("trackers") @SerialName("trackers") var trackers: List<String>?,
@JsonProperty("connected_seeders")
var connectedSeeders: Int?,
@JsonProperty("half_open_peers")
var halfOpenPeers: Int?,
@JsonProperty("bytes_written")
var bytesWritten: Long?,
@JsonProperty("bytes_written_data")
var bytesWrittenData: Long?,
@JsonProperty("bytes_read")
var bytesRead: Long?,
@JsonProperty("bytes_read_data")
var bytesReadData: Long?,
@JsonProperty("bytes_read_useful_data")
var bytesReadUsefulData: Long?,
@JsonProperty("chunks_written")
var chunksWritten: Long?,
@JsonProperty("chunks_read")
var chunksRead: Long?,
@JsonProperty("chunks_read_useful")
var chunksReadUseful: Long?,
@JsonProperty("chunks_read_wasted")
var chunksReadWasted: Long?,
@JsonProperty("pieces_dirtied_good")
var piecesDirtiedGood: Long?,
@JsonProperty("pieces_dirtied_bad")
var piecesDirtiedBad: Long?,
@JsonProperty("duration_seconds")
var durationSeconds: Double?,
@JsonProperty("bit_rate")
var bitRate: String?,
@JsonProperty("file_stats")
var fileStats: List<TorrentFileStat>?,
@JsonProperty("trackers")
var trackers: List<String>?,
) { ) {
fun streamUrl(url: String): String { fun streamUrl(url: String): String {
val fileName = val fileName =
@ -381,12 +342,10 @@ object Torrent {
} }
} }
@Serializable
data class TorrentFileStat( data class TorrentFileStat(
@JsonProperty("id") @JsonProperty("id") @SerialName("id") val id: Int?,
val id: Int?, @JsonProperty("path") @SerialName("path") val path: String?,
@JsonProperty("path") @JsonProperty("length") @SerialName("length") val length: Long?,
val path: String?,
@JsonProperty("length")
val length: Long?,
) )
} }

View file

@ -12,12 +12,16 @@ import com.lagradost.cloudstream3.utils.txt
import com.lagradost.cloudstream3.utils.DataStoreHelper.currentAccount import com.lagradost.cloudstream3.utils.DataStoreHelper.currentAccount
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities import com.lagradost.cloudstream3.utils.Qualities
import java.util.EnumMap
import java.util.concurrent.ConcurrentHashMap
import kotlin.also
import kotlin.math.abs import kotlin.math.abs
object QualityDataHelper { object QualityDataHelper {
private const val VIDEO_SOURCE_PRIORITY = "video_source_priority" private const val VIDEO_SOURCE_PRIORITY = "video_source_priority"
private const val VIDEO_PROFILE_NAME = "video_profile_name" private const val VIDEO_PROFILE_NAME = "video_profile_name"
private const val VIDEO_QUALITY_PRIORITY = "video_quality_priority" private const val VIDEO_QUALITY_PRIORITY = "video_quality_priority"
const val VIDEO_PROFILE_SETTINGS = "video_profile_settings"
// Old key only supporting one type per profile // Old key only supporting one type per profile
@Deprecated("Changed to support multiple types per profile") @Deprecated("Changed to support multiple types per profile")
@ -53,13 +57,21 @@ object QualityDataHelper {
val types: Set<QualityProfileType> val types: Set<QualityProfileType>
) )
// Map profile and name to priority
val sourcePriorityCache: ConcurrentHashMap<Int, HashMap<String, Int>> = ConcurrentHashMap()
fun getSourcePriority(profile: Int, name: String?): Int { fun getSourcePriority(profile: Int, name: String?): Int {
if (name == null) return DEFAULT_SOURCE_PRIORITY if (name == null) return DEFAULT_SOURCE_PRIORITY
return getKey(
return sourcePriorityCache[profile]?.get(name) ?: (getKey<Int>(
"$currentAccount/$VIDEO_SOURCE_PRIORITY/$profile", "$currentAccount/$VIDEO_SOURCE_PRIORITY/$profile",
name, name,
DEFAULT_SOURCE_PRIORITY DEFAULT_SOURCE_PRIORITY
) ?: DEFAULT_SOURCE_PRIORITY ) ?: DEFAULT_SOURCE_PRIORITY).also {
sourcePriorityCache.getOrPut(profile) { hashMapOf() }
sourcePriorityCache[profile]?.set(name, it)
}
} }
fun getAllSourcePriorityNames(profile: Int): List<String> { fun getAllSourcePriorityNames(profile: Int): List<String> {
@ -77,6 +89,8 @@ object QualityDataHelper {
} else { } else {
setKey(folder, name, priority) setKey(folder, name, priority)
} }
sourcePriorityCache[profile]?.set(name, priority)
} }
fun setProfileName(profile: Int, name: String?) { fun setProfileName(profile: Int, name: String?) {
@ -93,12 +107,17 @@ object QualityDataHelper {
?: txt(R.string.profile_number, profile) ?: txt(R.string.profile_number, profile)
} }
// Map profile and quality to priority
val qualityPriorityCache: ConcurrentHashMap<Int, EnumMap<Qualities, Int>> = ConcurrentHashMap()
fun getQualityPriority(profile: Int, quality: Qualities): Int { fun getQualityPriority(profile: Int, quality: Qualities): Int {
return getKey( return qualityPriorityCache[profile]?.get(quality) ?: (getKey<Int>(
"$currentAccount/$VIDEO_QUALITY_PRIORITY/$profile", "$currentAccount/$VIDEO_QUALITY_PRIORITY/$profile",
quality.value.toString(), quality.value.toString(),
quality.defaultPriority quality.defaultPriority
) ?: quality.defaultPriority )?.also {
qualityPriorityCache.getOrPut(profile) { EnumMap(Qualities::class.java) }
qualityPriorityCache[profile]?.set(quality, it)
}) ?: quality.defaultPriority
} }
fun setQualityPriority(profile: Int, quality: Qualities, priority: Int) { fun setQualityPriority(profile: Int, quality: Qualities, priority: Int) {
@ -107,8 +126,24 @@ object QualityDataHelper {
quality.value.toString(), quality.value.toString(),
priority priority
) )
qualityPriorityCache[profile]?.set(quality, priority)
} }
fun <T> setProfileSetting(profile: Int, setting: ProfileSettings<T>, value: T) {
val folder = "$currentAccount/$VIDEO_PROFILE_SETTINGS/$profile"
// Prevent unnecessary keys
if (value == setting.defaultValue) {
removeKey(folder, setting.key)
} else {
setKey(folder, setting.key, value)
}
}
inline fun <reified T : Any> getProfileSetting(profile: Int, setting: ProfileSettings<T>): T {
val folder = "$currentAccount/$VIDEO_PROFILE_SETTINGS/$profile"
val value = getKey<T>(folder, setting.key)
return value ?: setting.defaultValue
}
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
fun getQualityProfileTypes(profile: Int): Set<QualityProfileType> { fun getQualityProfileTypes(profile: Int): Set<QualityProfileType> {
@ -224,3 +259,8 @@ object QualityDataHelper {
return Qualities.entries.minBy { abs(it.value - target) } return Qualities.entries.minBy { abs(it.value - target) }
} }
} }
sealed class ProfileSettings<T>(val key: String, val defaultValue: T) {
object HideErrorSources : ProfileSettings<Boolean>("hide_error_sources", false)
object HideNegativeSources : ProfileSettings<Boolean>("hide_negative_sources", false)
}

View file

@ -14,7 +14,7 @@ import com.lagradost.cloudstream3.utils.UIHelper.fixSystemBarsPadding
class SourcePriorityDialog( class SourcePriorityDialog(
val ctx: Context, val ctx: Context,
@StyleRes themeRes: Int, @StyleRes val themeRes: Int,
val links: List<LinkSource>, val links: List<LinkSource>,
private val profile: QualityDataHelper.QualityProfile, private val profile: QualityDataHelper.QualityProfile,
/** /**
@ -28,28 +28,27 @@ class SourcePriorityDialog(
PlayerSelectSourcePriorityBinding.inflate(LayoutInflater.from(ctx), null, false) PlayerSelectSourcePriorityBinding.inflate(LayoutInflater.from(ctx), null, false)
setContentView(binding.root) setContentView(binding.root)
fixSystemBarsPadding(binding.root) fixSystemBarsPadding(binding.root)
val sourcesRecyclerView = binding.sortSources
val qualitiesRecyclerView = binding.sortQualities
val profileText = binding.profileTextEditable
val saveBtt = binding.saveBtt
val exitBtt = binding.closeBtt
val helpBtt = binding.helpBtt
profileText.setText(QualityDataHelper.getProfileName(profile.id).asString(context)) binding.apply {
profileText.hint = txt(R.string.profile_number, profile.id).asString(context) profileTextEditable.setText(
QualityDataHelper.getProfileName(profile.id).asString(context)
)
profileTextEditable.hint = txt(R.string.profile_number, profile.id).asString(context)
sourcesRecyclerView.adapter = PriorityAdapter<Nothing?>( sortSources.adapter = PriorityAdapter<Nothing?>(
).apply { ).apply {
submitList(links.map { link -> val sortedLinks = links.map { link ->
SourcePriority( SourcePriority(
null, null,
link.source, link.source,
QualityDataHelper.getSourcePriority(profile.id, link.source) QualityDataHelper.getSourcePriority(profile.id, link.source)
) )
}.distinctBy { it.name }.sortedBy { -it.priority }) }.distinctBy { it.name }.sortedBy { -it.priority }
submitList(sortedLinks)
} }
qualitiesRecyclerView.adapter = PriorityAdapter<Qualities>( sortQualities.adapter = PriorityAdapter<Qualities>(
).apply { ).apply {
submitList(Qualities.entries.mapNotNull { submitList(Qualities.entries.mapNotNull {
SourcePriority( SourcePriority(
@ -62,8 +61,8 @@ class SourcePriorityDialog(
@Suppress("UNCHECKED_CAST") // We know the types @Suppress("UNCHECKED_CAST") // We know the types
saveBtt.setOnClickListener { saveBtt.setOnClickListener {
val qualityAdapter = qualitiesRecyclerView.adapter as? PriorityAdapter<Qualities> val qualityAdapter = sortQualities.adapter as? PriorityAdapter<Qualities>
val sourcesAdapter = sourcesRecyclerView.adapter as? PriorityAdapter<Nothing?> val sourcesAdapter = sortSources.adapter as? PriorityAdapter<Nothing?>
val qualities = qualityAdapter?.immutableCurrentList ?: emptyList() val qualities = qualityAdapter?.immutableCurrentList ?: emptyList()
val sources = sourcesAdapter?.immutableCurrentList ?: emptyList() val sources = sourcesAdapter?.immutableCurrentList ?: emptyList()
@ -79,7 +78,7 @@ class SourcePriorityDialog(
qualityAdapter?.submitList(qualities.sortedBy { -it.priority }) qualityAdapter?.submitList(qualities.sortedBy { -it.priority })
sourcesAdapter?.submitList(sources.sortedBy { -it.priority }) sourcesAdapter?.submitList(sources.sortedBy { -it.priority })
val savedProfileName = profileText.text.toString() val savedProfileName = profileTextEditable.text.toString()
if (savedProfileName.isBlank()) { if (savedProfileName.isBlank()) {
QualityDataHelper.setProfileName(profile.id, null) QualityDataHelper.setProfileName(profile.id, null)
} else { } else {
@ -88,8 +87,8 @@ class SourcePriorityDialog(
updatedCallback.invoke() updatedCallback.invoke()
} }
exitBtt.setOnClickListener { closeBtt.setOnClickListener {
this.dismissSafe() dismissSafe()
} }
helpBtt.setOnClickListener { helpBtt.setOnClickListener {
@ -98,6 +97,10 @@ class SourcePriorityDialog(
}.show() }.show()
} }
settingsBtt.setOnClickListener {
SourceProfileSettingsDialog(ctx, themeRes, profile.id).show()
}
}
super.show() super.show()
} }
} }

View file

@ -0,0 +1,48 @@
package com.lagradost.cloudstream3.ui.player.source_priority
import android.app.Dialog
import android.content.Context
import android.view.LayoutInflater
import androidx.annotation.StyleRes
import com.lagradost.cloudstream3.databinding.SourceProfileSettingsDialogBinding
import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe
import com.lagradost.cloudstream3.utils.UIHelper.fixSystemBarsPadding
class SourceProfileSettingsDialog(
val ctx: Context,
@StyleRes themeRes: Int,
val profile: Int
) : Dialog(ctx, themeRes) {
override fun show() {
val binding =
SourceProfileSettingsDialogBinding.inflate(LayoutInflater.from(ctx), null, false)
setContentView(binding.root)
fixSystemBarsPadding(binding.root)
binding.apply {
var hideErrorSources = QualityDataHelper.getProfileSetting(profile, ProfileSettings.HideErrorSources)
var hideNegativeSources = QualityDataHelper.getProfileSetting(profile, ProfileSettings.HideNegativeSources)
profileHideErrorSources.isChecked = hideErrorSources
profileHideErrorSources.setOnCheckedChangeListener { _, bool ->
hideErrorSources = bool
}
profileHideNegativeSources.isChecked = hideNegativeSources
profileHideNegativeSources.setOnCheckedChangeListener { _, bool ->
hideNegativeSources = bool
}
applyBtt.setOnClickListener {
QualityDataHelper.setProfileSetting(profile, ProfileSettings.HideErrorSources, hideErrorSources)
QualityDataHelper.setProfileSetting(profile, ProfileSettings.HideNegativeSources, hideNegativeSources)
dismissSafe()
}
cancelBtt.setOnClickListener {
dismissSafe()
}
}
super.show()
}
}

View file

@ -5,6 +5,9 @@ import android.content.Intent
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.animation.Animation
import android.view.animation.OvershootInterpolator
import android.view.animation.ScaleAnimation
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.lagradost.cloudstream3.ActorData import com.lagradost.cloudstream3.ActorData
import com.lagradost.cloudstream3.ActorRole import com.lagradost.cloudstream3.ActorRole
@ -46,6 +49,24 @@ class ActorAdaptor(
} }
} }
override fun onUpdateContent(holder: ViewHolderState<Any>, item: ActorData, position: Int) {
when (val binding = holder.view) {
is CastItemBinding -> {
val anim: Animation = ScaleAnimation(
0.8f, 1f,
0.8f, 1f,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f
)
anim.fillAfter = true
anim.duration = 200
anim.interpolator = OvershootInterpolator()
binding.voiceActorImageHolder2.startAnimation(anim)
}
}
super.onUpdateContent(holder, item, position)
}
override fun onBindContent(holder: ViewHolderState<Any>, item: ActorData, position: Int) { override fun onBindContent(holder: ViewHolderState<Any>, item: ActorData, position: Int) {
when (val binding = holder.view) { when (val binding = holder.view) {
is CastItemBinding -> { is CastItemBinding -> {

View file

@ -21,6 +21,8 @@ import com.lagradost.cloudstream3.utils.DataStoreHelper.getViewPos
import com.lagradost.cloudstream3.utils.Event import com.lagradost.cloudstream3.utils.Event
import com.lagradost.cloudstream3.utils.ImageLoader.loadImage import com.lagradost.cloudstream3.utils.ImageLoader.loadImage
import com.lagradost.cloudstream3.utils.UiImage import com.lagradost.cloudstream3.utils.UiImage
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
const val START_ACTION_RESUME_LATEST = 1 const val START_ACTION_RESUME_LATEST = 1
const val START_ACTION_LOAD_EP = 2 const val START_ACTION_LOAD_EP = 2
@ -34,33 +36,32 @@ enum class VideoWatchState {
Watched Watched
} }
@Serializable
data class ResultEpisode( data class ResultEpisode(
val headerName: String, @SerialName("headerName") val headerName: String,
val name: String?, @SerialName("name") val name: String?,
val poster: String?, @SerialName("poster") val poster: String?,
val episode: Int, @SerialName("episode") val episode: Int,
val seasonIndex: Int?, // this is the "season" index used season names @SerialName("seasonIndex") val seasonIndex: Int?, // this is the "season" index used season names
val season: Int?, // this is the display @SerialName("season") val season: Int?, // this is the display
val data: String, @SerialName("data") val data: String,
val apiName: String, @SerialName("apiName") val apiName: String,
val id: Int, @SerialName("id") val id: Int,
val index: Int, @SerialName("index") val index: Int,
val position: Long, // time in MS @SerialName("position") val position: Long, // time in MS
val duration: Long, // duration in MS @SerialName("duration") val duration: Long, // duration in MS
val score: Score?, @SerialName("score") val score: Score?,
val description: String?, @SerialName("description") val description: String?,
val isFiller: Boolean?, @SerialName("isFiller") val isFiller: Boolean?,
val tvType: TvType, @SerialName("tvType") val tvType: TvType,
val parentId: Int, @SerialName("parentId") val parentId: Int,
/** /** Conveys if the episode itself is marked as watched. */
* Conveys if the episode itself is marked as watched @SerialName("videoWatchState") val videoWatchState: VideoWatchState,
**/ /** Sum of all previous season episode counts + episode. */
val videoWatchState: VideoWatchState, @SerialName("totalEpisodeIndex") val totalEpisodeIndex: Int? = null,
/** Sum of all previous season episode counts + episode */ @SerialName("airDate") val airDate: Long? = null,
val totalEpisodeIndex: Int? = null, @SerialName("runTime") val runTime: Int? = null,
val airDate: Long? = null, @SerialName("seasonData") val seasonData: SeasonData? = null,
val runTime: Int? = null,
val seasonData: SeasonData? = null,
) )
fun ResultEpisode.getRealPosition(): Long { fun ResultEpisode.getRealPosition(): Long {

View file

@ -877,7 +877,7 @@ class ResultFragmentTv : BaseFragment<FragmentResultTvBinding>(
resultCastText.setText(d.actorsText) resultCastText.setText(d.actorsText)
resultNextAiring.setText(d.nextAiringEpisode) resultNextAiring.setText(d.nextAiringEpisode)
resultNextAiringTime.setText(d.nextAiringDate) resultNextAiringTime.setText(d.nextAiringDate)
resultPoster.loadImage(d.posterImage) resultPoster.loadImage(d.posterImage, headers = d.posterHeaders)
var isExpanded = false var isExpanded = false
resultDescription.apply { resultDescription.apply {
@ -910,7 +910,7 @@ class ResultFragmentTv : BaseFragment<FragmentResultTvBinding>(
R.drawable.profile_bg_teal R.drawable.profile_bg_teal
).random() ).random()
backgroundPoster.loadImage(d.posterBackgroundImage) { backgroundPoster.loadImage(d.posterBackgroundImage, headers = d.posterHeaders) {
error { getImageFromDrawable(context ?: return@error null, error) } error { getImageFromDrawable(context ?: return@error null, error) }
} }

View file

@ -182,6 +182,7 @@ class SyncViewModel : ViewModel() {
fun publishUserData() = ioSafe { fun publishUserData() = ioSafe {
Log.i(TAG, "publishUserData") Log.i(TAG, "publishUserData")
val user = userData.value val user = userData.value
_userDataResponse.postValue(Resource.Loading())
if (user is Resource.Success) { if (user is Resource.Success) {
syncs.forEach { (prefix, id) -> syncs.forEach { (prefix, id) ->
repos.firstOrNull { it.idPrefix == prefix }?.updateStatus(id, user.value) repos.firstOrNull { it.idPrefix == prefix }?.updateStatus(id, user.value)

View file

@ -65,6 +65,8 @@ import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showBottomDialogTe
import com.lagradost.cloudstream3.utils.UIHelper.colorFromAttribute import com.lagradost.cloudstream3.utils.UIHelper.colorFromAttribute
import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe
import com.lagradost.cloudstream3.utils.UIHelper.hideKeyboard import com.lagradost.cloudstream3.utils.UIHelper.hideKeyboard
import com.lagradost.cloudstream3.utils.UIHelper.hideProgress
import com.lagradost.cloudstream3.utils.UIHelper.showProgress
import com.lagradost.cloudstream3.utils.setText import com.lagradost.cloudstream3.utils.setText
import com.lagradost.cloudstream3.utils.txt import com.lagradost.cloudstream3.utils.txt
import qrcode.QRCode import qrcode.QRCode
@ -348,6 +350,7 @@ class SettingsAccount : BasePreferenceFragmentCompat(), BiometricCallback {
email = if (req.email) binding.loginEmailInput.text?.toString() else null, email = if (req.email) binding.loginEmailInput.text?.toString() else null,
server = if (req.server) binding.loginServerInput.text?.toString() else null, server = if (req.server) binding.loginServerInput.text?.toString() else null,
) )
binding.applyBtt.showProgress()
ioSafe { ioSafe {
try { try {
if (api.login(loginData)) { if (api.login(loginData)) {
@ -377,6 +380,8 @@ class SettingsAccount : BasePreferenceFragmentCompat(), BiometricCallback {
api.name api.name
) )
) )
} finally {
binding.applyBtt.hideProgress()
} }
} }
} }

View file

@ -249,7 +249,7 @@ class SettingsFragment : BaseFragment<MainSettingsBinding>(
val appVersion = BuildConfig.VERSION_NAME val appVersion = BuildConfig.VERSION_NAME
val commitHash = activity?.currentCommitHash() ?: "" val commitHash = activity?.currentCommitHash() ?: ""
val buildTimestamp = SimpleDateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, val buildTimestamp = SimpleDateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.MEDIUM,
Locale.getDefault() Locale.getDefault()
).apply { timeZone = TimeZone.getTimeZone("UTC") ).apply { timeZone = TimeZone.getTimeZone("UTC")
}.format(Date(BuildConfig.BUILD_DATE)).replace("UTC", "") }.format(Date(BuildConfig.BUILD_DATE)).replace("UTC", "")

View file

@ -10,6 +10,7 @@ import androidx.core.content.edit
import androidx.core.os.ConfigurationCompat import androidx.core.os.ConfigurationCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import com.fasterxml.jackson.annotation.JsonAlias
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.APIHolder.allProviders import com.lagradost.cloudstream3.APIHolder.allProviders
import com.lagradost.cloudstream3.CloudStreamApp import com.lagradost.cloudstream3.CloudStreamApp
@ -48,8 +49,10 @@ import com.lagradost.cloudstream3.utils.USER_PROVIDER_API
import com.lagradost.cloudstream3.utils.downloader.DownloadFileManagement import com.lagradost.cloudstream3.utils.downloader.DownloadFileManagement
import com.lagradost.cloudstream3.utils.downloader.DownloadFileManagement.getBasePath import com.lagradost.cloudstream3.utils.downloader.DownloadFileManagement.getBasePath
import com.lagradost.cloudstream3.utils.downloader.DownloadQueueManager import com.lagradost.cloudstream3.utils.downloader.DownloadQueueManager
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonNames
import java.util.Locale import java.util.Locale
// Change local language settings in the app. // Change local language settings in the app.
@ -74,6 +77,7 @@ val appLanguages = arrayListOf(
Pair("Azərbaycan dili", "az"), Pair("Azərbaycan dili", "az"),
Pair("Bahasa Indonesia", "in"), Pair("Bahasa Indonesia", "in"),
Pair("Bahasa Melayu", "ms"), Pair("Bahasa Melayu", "ms"),
Pair("català", "ca"),
Pair("Deutsch", "de"), Pair("Deutsch", "de"),
Pair("English", "en"), Pair("English", "en"),
Pair("Español", "es"), Pair("Español", "es"),
@ -94,6 +98,7 @@ val appLanguages = arrayListOf(
Pair("Português", "pt"), Pair("Português", "pt"),
Pair("Português (Brasil)", "pt-BR"), Pair("Português (Brasil)", "pt-BR"),
Pair("Română", "ro"), Pair("Română", "ro"),
Pair("Shqip мова", "sq"),
Pair("Slovenčina", "sk"), Pair("Slovenčina", "sk"),
Pair("Soomaaliga", "so"), Pair("Soomaaliga", "so"),
Pair("Svenska", "sv"), Pair("Svenska", "sv"),
@ -103,6 +108,7 @@ val appLanguages = arrayListOf(
Pair("Wikang Filipino", "fil"), Pair("Wikang Filipino", "fil"),
Pair("Čeština", "cs"), Pair("Čeština", "cs"),
Pair("Ελληνικά", "el"), Pair("Ελληνικά", "el"),
Pair("беларуская мова", "be"),
Pair("български", "bg"), Pair("български", "bg"),
Pair("македонски", "mk"), Pair("македонски", "mk"),
Pair("русский", "ru"), Pair("русский", "ru"),
@ -147,9 +153,12 @@ class SettingsGeneral : BasePreferenceFragmentCompat() {
setToolBarScrollFlags() setToolBarScrollFlags()
} }
@OptIn(ExperimentalSerializationApi::class) // JsonNames is an experimental annotation for now
@Serializable @Serializable
data class CustomSite( data class CustomSite(
@JsonProperty("parentJavaClass") @SerialName("parentJavaClass") val parentJavaClass: String, // javaClass.simpleName @JsonProperty("parentClassName") @JsonAlias("parentJavaClass")
@SerialName("parentClassName") @JsonNames("parentJavaClass")
val parentClassName: String, // ::class.simpleName
@JsonProperty("name") @SerialName("name") val name: String, @JsonProperty("name") @SerialName("name") val name: String,
@JsonProperty("url") @SerialName("url") val url: String, @JsonProperty("url") @SerialName("url") val url: String,
@JsonProperty("lang") @SerialName("lang") val lang: String, @JsonProperty("lang") @SerialName("lang") val lang: String,
@ -242,13 +251,14 @@ class SettingsGeneral : BasePreferenceFragmentCompat() {
val url = binding.siteUrlInput.text?.toString() val url = binding.siteUrlInput.text?.toString()
val lang = binding.siteLangInput.text?.toString() val lang = binding.siteLangInput.text?.toString()
val realLang = if (lang.isNullOrBlank()) provider.lang else lang val realLang = if (lang.isNullOrBlank()) provider.lang else lang
if (url.isNullOrBlank() || name.isNullOrBlank()) { val simpleName = provider::class.simpleName
if (url.isNullOrBlank() || name.isNullOrBlank() || simpleName == null) {
showToast(R.string.error_invalid_data, Toast.LENGTH_SHORT) showToast(R.string.error_invalid_data, Toast.LENGTH_SHORT)
return@setOnClickListener return@setOnClickListener
} }
val current = getCurrent() val current = getCurrent()
val newSite = CustomSite(provider.javaClass.simpleName, name, url, realLang) val newSite = CustomSite(simpleName, name, url, realLang)
current.add(newSite) current.add(newSite)
setKey(USER_PROVIDER_API, current.toTypedArray()) setKey(USER_PROVIDER_API, current.toTypedArray())
// reload apis // reload apis
@ -352,7 +362,7 @@ class SettingsGeneral : BasePreferenceFragmentCompat() {
} ?: emptyList() } ?: emptyList()
} }
settingsManager.edit { putBoolean(getString(R.string.jsdelivr_proxy_key), getKey(getString(R.string.jsdelivr_proxy_key), false) ?: false) } settingsManager.edit { putBoolean(getString(R.string.jsdelivr_proxy_key), getKey<Boolean>(getString(R.string.jsdelivr_proxy_key), false) ?: false) }
getPref(R.string.jsdelivr_proxy_key)?.setOnPreferenceChangeListener { _, newValue -> getPref(R.string.jsdelivr_proxy_key)?.setOnPreferenceChangeListener { _, newValue ->
setKey(getString(R.string.jsdelivr_proxy_key), newValue) setKey(getString(R.string.jsdelivr_proxy_key), newValue)
return@setOnPreferenceChangeListener true return@setOnPreferenceChangeListener true

View file

@ -205,29 +205,35 @@ class SettingsPlayer : BasePreferenceFragmentCompat() {
} }
getPref(R.string.player_default_key)?.setOnPreferenceClickListener { getPref(R.string.player_default_key)?.setOnPreferenceClickListener {
val players = VideoClickActionHolder.getPlayers(activity) // Pair each player with its display name, dropping any with none,
val prefNames = buildList { // which would mean something is definitely wrong.
add(getString(R.string.player_settings_play_in_app)) val players = VideoClickActionHolder.getPlayers(activity).mapNotNull { player ->
addAll(players.map { it.name.asStringNull(activity) ?: it.javaClass.simpleName }) (player.name.asStringNull(activity) ?: player::class.simpleName)?.let { player to it }
} }
val prefValues = buildList {
add("")
addAll(players.map { it.uniqueId() })
}
val current =
settingsManager.getString(getString(R.string.player_default_key), "") ?: ""
val prefNames = buildList {
add(getString(R.string.player_settings_play_in_app)) // built-in player display name
addAll(players.map { (_, name) -> name })
}
val prefValues = buildList {
add("") // "" = built-in player, matches default
addAll(players.map { (player, _) -> player.uniqueId() })
}
val current = settingsManager.getString(getString(R.string.player_default_key), "") ?: ""
activity?.showBottomDialog( activity?.showBottomDialog(
prefNames.toList(), prefNames.toList(),
prefValues.indexOf(current), prefValues.indexOf(current), // finds index of currently selected player
getString(R.string.player_pref), getString(R.string.player_pref),
true, true,
{} {},
) { ) {
settingsManager.edit { settingsManager.edit {
putString(getString(R.string.player_default_key), prefValues[it]) putString(getString(R.string.player_default_key), prefValues[it])
} }
} }
return@setOnPreferenceClickListener true return@setOnPreferenceClickListener true
} }

View file

@ -228,6 +228,8 @@ class SettingsUI : BasePreferenceFragmentCompat() {
return@setOnPreferenceClickListener true return@setOnPreferenceClickListener true
} }
getPref(R.string.tv_layout_clock_key)?.hideOn(PHONE or EMULATOR)
getPref(R.string.confirm_exit_key)?.setOnPreferenceClickListener { getPref(R.string.confirm_exit_key)?.setOnPreferenceClickListener {
val prefNames = resources.getStringArray(R.array.confirm_exit) val prefNames = resources.getStringArray(R.array.confirm_exit)
val prefValues = resources.getIntArray(R.array.confirm_exit_values) val prefValues = resources.getIntArray(R.array.confirm_exit_values)

View file

@ -39,6 +39,8 @@ import com.lagradost.cloudstream3.utils.AppContextUtils.setDefaultFocus
import com.lagradost.cloudstream3.utils.Coroutines.ioSafe import com.lagradost.cloudstream3.utils.Coroutines.ioSafe
import com.lagradost.cloudstream3.utils.Coroutines.main import com.lagradost.cloudstream3.utils.Coroutines.main
import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe
import com.lagradost.cloudstream3.utils.UIHelper.hideProgress
import com.lagradost.cloudstream3.utils.UIHelper.showProgress
import com.lagradost.cloudstream3.utils.setText import com.lagradost.cloudstream3.utils.setText
class ExtensionsFragment : BaseFragment<FragmentExtensionsBinding>( class ExtensionsFragment : BaseFragment<FragmentExtensionsBinding>(
@ -114,11 +116,7 @@ class ExtensionsFragment : BaseFragment<FragmentExtensionsBinding>(
adapter = RepoAdapter(false, { adapter = RepoAdapter(false, {
findNavController().navigate( findNavController().navigate(
R.id.navigation_settings_extensions_to_navigation_settings_plugins, R.id.navigation_settings_extensions_to_navigation_settings_plugins,
PluginsFragment.newInstance( PluginsFragment.newInstance(it)
it.name,
it.url,
false
)
) )
}, { repo -> }, { repo ->
// Prompt user before deleting repo // Prompt user before deleting repo
@ -156,7 +154,7 @@ class ExtensionsFragment : BaseFragment<FragmentExtensionsBinding>(
binding.repoRecyclerView.isVisible = repos.isNotEmpty() binding.repoRecyclerView.isVisible = repos.isNotEmpty()
binding.blankRepoScreen.isVisible = repos.isEmpty() binding.blankRepoScreen.isVisible = repos.isEmpty()
(binding.repoRecyclerView.adapter as? RepoAdapter)?.submitList(repos.toList()) (binding.repoRecyclerView.adapter as? RepoAdapter)?.submitList(repos.toList())
pluginViewModel.updatePluginList(binding.root.context, repos.map { it.url }) pluginViewModel.updatePluginList(binding.root.context, repos.toList())
} }
observeNullable(extensionViewModel.pluginStats) { value -> observeNullable(extensionViewModel.pluginStats) { value ->
@ -185,10 +183,8 @@ class ExtensionsFragment : BaseFragment<FragmentExtensionsBinding>(
binding.pluginStorageAppbar.setOnClickListener { binding.pluginStorageAppbar.setOnClickListener {
findNavController().navigate( findNavController().navigate(
R.id.navigation_settings_extensions_to_navigation_settings_plugins, R.id.navigation_settings_extensions_to_navigation_settings_plugins,
PluginsFragment.newInstance( PluginsFragment.newLocalInstance(
getString(R.string.extensions), getString(R.string.extensions),
"",
true
) )
) )
} }
@ -201,9 +197,8 @@ class ExtensionsFragment : BaseFragment<FragmentExtensionsBinding>(
) )
setRecycledViewPool(PluginAdapter.sharedPool) setRecycledViewPool(PluginAdapter.sharedPool)
adapter = adapter =
PluginAdapter { PluginAdapter(true) {
val urls = extensionViewModel.repositories.value?.map { repo -> repo.url } val urls = extensionViewModel.repositories.value?.toList() ?: emptyList()
?: emptyList()
pluginViewModel.handlePluginAction(activity, urls, it, false) pluginViewModel.handlePluginAction(activity, urls, it, false)
} }
} }
@ -285,13 +280,18 @@ class ExtensionsFragment : BaseFragment<FragmentExtensionsBinding>(
binding.applyBtt.setOnClickListener secondListener@{ binding.applyBtt.setOnClickListener secondListener@{
val name = binding.repoNameInput.text?.toString() val name = binding.repoNameInput.text?.toString()
val urlInput = binding.repoUrlInput.text?.toString() val urlInput = binding.repoUrlInput.text?.toString()
ioSafe { if (urlInput.isNullOrEmpty()) {
val url = urlInput?.let { it1 -> RepositoryManager.parseRepoUrl(it1) } showToast(R.string.error_invalid_url, Toast.LENGTH_SHORT)
if (url.isNullOrBlank()) { return@secondListener
main { }
showToast(R.string.error_invalid_data, Toast.LENGTH_SHORT) binding.applyBtt.showProgress()
ioSafe {
try {
val url = RepositoryManager.parseRepoUrl(urlInput)
if (url.isNullOrBlank()) {
showToast(R.string.error_invalid_data, Toast.LENGTH_SHORT)
return@ioSafe
} }
} else {
val repository = RepositoryManager.parseRepository(url) val repository = RepositoryManager.parseRepository(url)
// Exit if wrong repository // Exit if wrong repository
@ -307,24 +307,28 @@ class ExtensionsFragment : BaseFragment<FragmentExtensionsBinding>(
extensionViewModel.loadStats() extensionViewModel.loadStats()
extensionViewModel.loadRepositories() extensionViewModel.loadRepositories()
val plugins = RepositoryManager.getRepoPlugins(url) dialog.dismissSafe(activity) // Only dismiss if the repo was added
val plugins = RepositoryManager.getRepoPlugins(newRepo)
if (plugins.isNullOrEmpty()) { if (plugins.isNullOrEmpty()) {
showToast(R.string.no_plugins_found_error, Toast.LENGTH_LONG) showToast(R.string.no_plugins_found_error, Toast.LENGTH_LONG)
} else { return@ioSafe
}
this@ExtensionsFragment.activity?.addRepositoryDialog( this@ExtensionsFragment.activity?.addRepositoryDialog(
fixedName, newRepo
url,
) )
} finally {
binding.applyBtt.hideProgress()
} }
} }
} }
dialog.dismissSafe(activity)
}
binding.cancelBtt.setOnClickListener { binding.cancelBtt.setOnClickListener {
dialog.dismissSafe(activity) dialog.dismissSafe(activity)
} }
} }
val isTv = isLayout(TV) val isTv = isLayout(TV)
binding.apply { binding.apply {
addRepoButton.isGone = isTv addRepoButton.isGone = isTv

View file

@ -55,16 +55,16 @@ class ExtensionsViewModel : ViewModel() {
?: emptyArray()) + PREBUILT_REPOSITORIES ?: emptyArray()) + PREBUILT_REPOSITORIES
val onlinePlugins = urls.toList().amap { val onlinePlugins = urls.toList().amap {
RepositoryManager.getRepoPlugins(it.url)?.toList() ?: emptyList() RepositoryManager.getRepoPlugins(it)?.toList() ?: emptyList()
}.flatten().distinctBy { it.second.url } }.flatten().distinctBy { it.plugin.url }
// Iterates over all offline plugins, compares to remote repo and returns the plugins which are outdated // Iterates over all offline plugins, compares to remote repo and returns the plugins which are outdated
val outdatedPlugins = getPluginsOnline().map { savedData -> val outdatedPlugins = getPluginsOnline().flatMap { savedData ->
onlinePlugins.filter { onlineData -> savedData.internalName == onlineData.second.internalName } onlinePlugins.filter { onlineData -> savedData.internalName == onlineData.plugin.internalName }
.map { onlineData -> .map { onlineData ->
PluginManager.OnlinePluginData(savedData, onlineData) PluginManager.OnlinePluginData(savedData, onlineData)
} }
}.flatten().distinctBy { it.onlineData.second.url } }.distinctBy { it.onlineData.plugin.url }
val total = onlinePlugins.count() val total = onlinePlugins.count()
val disabled = outdatedPlugins.count { it.isDisabled } val disabled = outdatedPlugins.count { it.isDisabled }

View file

@ -15,6 +15,7 @@ import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.TvType import com.lagradost.cloudstream3.TvType
import com.lagradost.cloudstream3.databinding.RepositoryItemBinding import com.lagradost.cloudstream3.databinding.RepositoryItemBinding
import com.lagradost.cloudstream3.plugins.PluginManager import com.lagradost.cloudstream3.plugins.PluginManager
import com.lagradost.cloudstream3.plugins.PluginWrapper
import com.lagradost.cloudstream3.ui.BaseDiffCallback import com.lagradost.cloudstream3.ui.BaseDiffCallback
import com.lagradost.cloudstream3.ui.NoStateAdapter import com.lagradost.cloudstream3.ui.NoStateAdapter
import com.lagradost.cloudstream3.ui.ViewHolderState import com.lagradost.cloudstream3.ui.ViewHolderState
@ -34,7 +35,7 @@ import kotlin.math.log10
import kotlin.math.pow import kotlin.math.pow
data class PluginViewData( data class PluginViewData(
val plugin: Plugin, val pluginWrapper: PluginWrapper,
val isDownloaded: Boolean, val isDownloaded: Boolean,
) )
@ -44,9 +45,9 @@ class RepositoryViewHolderState(view: ViewBinding) : ViewHolderState<Any>(view)
} }
class PluginAdapter( class PluginAdapter(
val iconClickCallback: (Plugin) -> Unit val showRepositoryNames: Boolean = false, val iconClickCallback: (PluginWrapper) -> Unit,
) : NoStateAdapter<PluginViewData>(diffCallback = BaseDiffCallback(itemSame = { a, b -> ) : NoStateAdapter<PluginViewData>(diffCallback = BaseDiffCallback(itemSame = { a, b ->
a.plugin.second.internalName == b.plugin.second.internalName && a.plugin.first == b.plugin.first a.pluginWrapper.plugin.internalName == b.pluginWrapper.plugin.internalName && a.pluginWrapper.repositoryData.url == b.pluginWrapper.repositoryData.url
})) { })) {
override fun onCreateContent(parent: ViewGroup): ViewHolderState<Any> { override fun onCreateContent(parent: ViewGroup): ViewHolderState<Any> {
val layout = if (isLayout(TV)) R.layout.repository_item_tv else R.layout.repository_item val layout = if (isLayout(TV)) R.layout.repository_item_tv else R.layout.repository_item
@ -73,14 +74,22 @@ class PluginAdapter(
val binding = holder.view as? RepositoryItemBinding ?: return val binding = holder.view as? RepositoryItemBinding ?: return
val itemView = holder.itemView val itemView = holder.itemView
val metadata = item.plugin.second val metadata = item.pluginWrapper.plugin
val disabled = metadata.status == PROVIDER_STATUS_DOWN val disabled = metadata.status == PROVIDER_STATUS_DOWN
val name = metadata.name.removeSuffix("Provider") val name = metadata.name.removeSuffix("Provider")
val alpha = if (disabled) 0.6f else 1f val alpha = if (disabled) 0.6f else 1f
val isLocal = !item.plugin.second.url.startsWith("http") val isLocal = !item.pluginWrapper.plugin.url.startsWith("http")
binding.mainText.alpha = alpha binding.mainText.alpha = alpha
binding.subText.alpha = alpha binding.subText.alpha = alpha
binding.repositoryNameText.isVisible = showRepositoryNames
if (showRepositoryNames) {
val name = item.pluginWrapper.repositoryData.name
binding.repositoryNameText.text = name
} else {
binding.repositoryNameText.text = ""
}
val drawableInt = if (item.isDownloaded) val drawableInt = if (item.isDownloaded)
R.drawable.ic_baseline_delete_outline_24 R.drawable.ic_baseline_delete_outline_24
else R.drawable.netflix_download else R.drawable.netflix_download
@ -89,7 +98,7 @@ class PluginAdapter(
binding.actionButton.setImageResource(drawableInt) binding.actionButton.setImageResource(drawableInt)
binding.actionButton.setOnClickListener { binding.actionButton.setOnClickListener {
iconClickCallback.invoke(item.plugin) iconClickCallback.invoke(item.pluginWrapper)
} }
itemView.setOnClickListener { itemView.setOnClickListener {
if (isLocal) return@setOnClickListener if (isLocal) return@setOnClickListener

View file

@ -54,7 +54,7 @@ class PluginDetailsFragment(val data: PluginViewData) : BaseBottomSheetDialogFra
} }
override fun onBindingCreated(binding: FragmentPluginDetailsBinding) { override fun onBindingCreated(binding: FragmentPluginDetailsBinding) {
val metadata = data.plugin.second val metadata = data.pluginWrapper.plugin
binding.apply { binding.apply {
pluginIcon.loadImage(metadata.iconUrl?.replace("%size%", "$iconSize") pluginIcon.loadImage(metadata.iconUrl?.replace("%size%", "$iconSize")
?.replace("%exact_size%", "$iconSizeExact")) { ?.replace("%exact_size%", "$iconSizeExact")) {
@ -135,7 +135,7 @@ class PluginDetailsFragment(val data: PluginViewData) : BaseBottomSheetDialogFra
} }
private fun updateVoting(value: Int) { private fun updateVoting(value: Int) {
val metadata = data.plugin.second val metadata = data.pluginWrapper.plugin
binding?.apply { binding?.apply {
pluginVotes.text = value.toString() pluginVotes.text = value.toString()
if (metadata.hasVoted()) { if (metadata.hasVoted()) {

View file

@ -23,12 +23,13 @@ import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setSyst
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setToolBarScrollFlags import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setToolBarScrollFlags
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setUpToolbar import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setUpToolbar
import com.lagradost.cloudstream3.utils.AppContextUtils.getApiProviderLangSettings import com.lagradost.cloudstream3.utils.AppContextUtils.getApiProviderLangSettings
import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showMultiDialog import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showMultiDialog
import com.lagradost.cloudstream3.utils.SubtitleHelper.getNameNextToFlagEmoji import com.lagradost.cloudstream3.utils.SubtitleHelper.getNameNextToFlagEmoji
import com.lagradost.cloudstream3.utils.UIHelper.toPx import com.lagradost.cloudstream3.utils.UIHelper.toPx
const val PLUGINS_BUNDLE_NAME = "name" const val PLUGINS_BUNDLE_DATA = "data"
const val PLUGINS_BUNDLE_URL = "url"
const val PLUGINS_BUNDLE_LOCAL = "isLocal" const val PLUGINS_BUNDLE_LOCAL = "isLocal"
class PluginsFragment : BaseFragment<FragmentPluginsBinding>( class PluginsFragment : BaseFragment<FragmentPluginsBinding>(
@ -61,24 +62,25 @@ class PluginsFragment : BaseFragment<FragmentPluginsBinding>(
} }
} }
val name = arguments?.getString(PLUGINS_BUNDLE_NAME) val repositoryData = arguments?.getString(PLUGINS_BUNDLE_DATA)?.let { data ->
val url = arguments?.getString(PLUGINS_BUNDLE_URL) tryParseJson<RepositoryData>(data)
}
val isLocal = arguments?.getBoolean(PLUGINS_BUNDLE_LOCAL) == true val isLocal = arguments?.getBoolean(PLUGINS_BUNDLE_LOCAL) == true
// download all extensions button // download all extensions button
val downloadAllButton = binding.settingsToolbar.menu?.findItem(R.id.download_all) val downloadAllButton = binding.settingsToolbar.menu?.findItem(R.id.download_all)
if (url == null || name == null) { if (repositoryData == null) {
dispatchBackPressed() dispatchBackPressed()
return return
} }
setToolBarScrollFlags() setToolBarScrollFlags()
setUpToolbar(name) setUpToolbar(repositoryData.name)
binding.settingsToolbar.apply { binding.settingsToolbar.apply {
setOnMenuItemClickListener { menuItem -> setOnMenuItemClickListener { menuItem ->
when (menuItem?.itemId) { when (menuItem?.itemId) {
R.id.download_all -> { R.id.download_all -> {
PluginsViewModel.downloadAll(activity, url, pluginViewModel) PluginsViewModel.downloadAll(activity, repositoryData, pluginViewModel)
} }
R.id.lang_filter -> { R.id.lang_filter -> {
@ -159,7 +161,7 @@ class PluginsFragment : BaseFragment<FragmentPluginsBinding>(
setRecycledViewPool(PluginAdapter.sharedPool) setRecycledViewPool(PluginAdapter.sharedPool)
adapter = adapter =
PluginAdapter { PluginAdapter {
pluginViewModel.handlePluginAction(activity, listOf(url), it, isLocal) pluginViewModel.handlePluginAction(activity, listOf(repositoryData), it, isLocal)
} }
} }
@ -183,7 +185,7 @@ class PluginsFragment : BaseFragment<FragmentPluginsBinding>(
binding.tvtypesChipsScroll.root.isVisible = false binding.tvtypesChipsScroll.root.isVisible = false
} else { } else {
pluginViewModel.updatePluginList(context, listOf(url)) pluginViewModel.updatePluginList(context, listOf(repositoryData))
binding.tvtypesChipsScroll.root.isVisible = true binding.tvtypesChipsScroll.root.isVisible = true
// not needed for users but may be useful for devs // not needed for users but may be useful for devs
downloadAllButton?.isVisible = BuildConfig.DEBUG downloadAllButton?.isVisible = BuildConfig.DEBUG
@ -204,21 +206,17 @@ class PluginsFragment : BaseFragment<FragmentPluginsBinding>(
} }
companion object { companion object {
fun newInstance(name: String, url: String, isLocal: Boolean): Bundle { fun newInstance(repositoryData: RepositoryData): Bundle {
return Bundle().apply { return Bundle().apply {
putString(PLUGINS_BUNDLE_NAME, name) putString(PLUGINS_BUNDLE_DATA, repositoryData.toJson())
putString(PLUGINS_BUNDLE_URL, url) putBoolean(PLUGINS_BUNDLE_LOCAL, false)
putBoolean(PLUGINS_BUNDLE_LOCAL, isLocal) }
}
fun newLocalInstance(name: String): Bundle {
return Bundle().apply {
putString(PLUGINS_BUNDLE_DATA, RepositoryData("", name, "").toJson())
putBoolean(PLUGINS_BUNDLE_LOCAL, true)
} }
} }
// class RepoSearchView(context: Context) : android.widget.SearchView(context) {
// var onActionViewCollapsed = {}
//
// override fun onActionViewCollapsed() {
// onActionViewCollapsed()
// }
// }
} }
} }

View file

@ -17,8 +17,8 @@ import com.lagradost.cloudstream3.amap
import com.lagradost.cloudstream3.mvvm.launchSafe import com.lagradost.cloudstream3.mvvm.launchSafe
import com.lagradost.cloudstream3.plugins.PluginManager import com.lagradost.cloudstream3.plugins.PluginManager
import com.lagradost.cloudstream3.plugins.PluginManager.getPluginPath import com.lagradost.cloudstream3.plugins.PluginManager.getPluginPath
import com.lagradost.cloudstream3.plugins.PluginWrapper
import com.lagradost.cloudstream3.plugins.RepositoryManager import com.lagradost.cloudstream3.plugins.RepositoryManager
import com.lagradost.cloudstream3.plugins.SitePlugin
import com.lagradost.cloudstream3.utils.txt import com.lagradost.cloudstream3.utils.txt
import com.lagradost.cloudstream3.utils.Coroutines.ioSafe import com.lagradost.cloudstream3.utils.Coroutines.ioSafe
import com.lagradost.cloudstream3.utils.Coroutines.main import com.lagradost.cloudstream3.utils.Coroutines.main
@ -26,8 +26,6 @@ import com.lagradost.cloudstream3.utils.Coroutines.runOnMainThread
import com.lagradost.cloudstream3.utils.Levenshtein import com.lagradost.cloudstream3.utils.Levenshtein
import java.io.File import java.io.File
// String => repository url
typealias Plugin = Pair<String, SitePlugin>
/** /**
* The boolean signifies if the plugin list should be scrolled to the top, used for searching. * The boolean signifies if the plugin list should be scrolled to the top, used for searching.
* */ * */
@ -40,7 +38,7 @@ class PluginsViewModel : ViewModel() {
set(value) { set(value) {
// Also set all the plugin languages for easier filtering // Also set all the plugin languages for easier filtering
value.map { pluginViewData -> value.map { pluginViewData ->
val language = pluginViewData.plugin.second.language?.lowercase() val language = pluginViewData.pluginWrapper.plugin.language?.lowercase()
pluginLanguages.add( pluginLanguages.add(
when { when {
language.isNullOrBlank() -> "none" language.isNullOrBlank() -> "none"
@ -62,7 +60,7 @@ class PluginsViewModel : ViewModel() {
private var currentQuery: String? = null private var currentQuery: String? = null
companion object { companion object {
private val repositoryCache: MutableMap<String, List<Plugin>> = mutableMapOf() private val repositoryCache: MutableMap<String, List<PluginWrapper>> = mutableMapOf()
const val TAG = "PLG" const val TAG = "PLG"
private fun isDownloaded( private fun isDownloaded(
@ -74,32 +72,33 @@ class PluginsViewModel : ViewModel() {
} }
private suspend fun getPlugins( private suspend fun getPlugins(
repositoryUrl: String, repository: RepositoryData,
canUseCache: Boolean = true canUseCache: Boolean = true
): List<Plugin> { ): List<PluginWrapper> {
Log.i(TAG, "getPlugins = $repositoryUrl") Log.i(TAG, "getPlugins = $repository")
if (canUseCache && repositoryCache.containsKey(repositoryUrl)) { if (canUseCache && repositoryCache.containsKey(repository.url)) {
repositoryCache[repositoryUrl]?.let { repositoryCache[repository.url]?.let {
return it return it
} }
} }
return RepositoryManager.getRepoPlugins(repositoryUrl)
?.also { repositoryCache[repositoryUrl] = it } ?: emptyList() return RepositoryManager.getRepoPlugins(repository)
?.also { repositoryCache[repository.url] = it } ?: emptyList()
} }
/** /**
* @param viewModel optional, updates the plugins livedata for that viewModel if included * @param viewModel optional, updates the plugins livedata for that viewModel if included
* */ * */
fun downloadAll(activity: Activity?, repositoryUrl: String, viewModel: PluginsViewModel?) = fun downloadAll(activity: Activity?, repository: RepositoryData, viewModel: PluginsViewModel?) =
ioSafe { ioSafe {
if (activity == null) return@ioSafe if (activity == null) return@ioSafe
val plugins = getPlugins(repositoryUrl) val plugins = getPlugins(repository)
plugins.filter { plugin -> plugins.filter { pluginWrapper ->
!isDownloaded( !isDownloaded(
activity, activity,
plugin.second.internalName, pluginWrapper.plugin.internalName,
repositoryUrl repository.url
) )
}.also { list -> }.also { list ->
main { main {
@ -124,13 +123,13 @@ class PluginsViewModel : ViewModel() {
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
) )
} }
}.amap { (repo, metadata) -> }.amap { (_, repo, metadata) ->
PluginManager.downloadPlugin( PluginManager.downloadPlugin(
activity, activity,
metadata.url, metadata.url,
metadata.fileHash, metadata.fileHash,
metadata.internalName, metadata.internalName,
repo, repo.url,
metadata.status != PROVIDER_STATUS_DOWN metadata.status != PROVIDER_STATUS_DOWN
) )
}.main { list -> }.main { list ->
@ -143,7 +142,7 @@ class PluginsViewModel : ViewModel() {
), ),
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
) )
viewModel?.updatePluginListPrivate(activity, listOf(repositoryUrl)) viewModel?.updatePluginListPrivate(activity, listOf(repository))
} else if (list.isNotEmpty()) { } else if (list.isNotEmpty()) {
showToast(R.string.download_failed, Toast.LENGTH_SHORT) showToast(R.string.download_failed, Toast.LENGTH_SHORT)
} }
@ -157,32 +156,32 @@ class PluginsViewModel : ViewModel() {
* */ * */
fun handlePluginAction( fun handlePluginAction(
activity: Activity?, activity: Activity?,
repositoryUrls: List<String>, repositoryUrls: List<RepositoryData>,
plugin: Plugin, pluginWrapper: PluginWrapper,
isLocal: Boolean isLocal: Boolean
) = ioSafe { ) = ioSafe {
Log.i(TAG, "handlePluginAction = ${repositoryUrls}, $plugin, $isLocal") Log.i(TAG, "handlePluginAction = ${repositoryUrls}, $pluginWrapper, $isLocal")
if (activity == null) return@ioSafe if (activity == null) return@ioSafe
val (repo, metadata) = plugin val (_, repositoryData, metadata) = pluginWrapper
val file = if (isLocal) File(plugin.second.url) else getPluginPath( val file = if (isLocal) File(pluginWrapper.plugin.url) else getPluginPath(
activity, activity,
plugin.second.internalName, pluginWrapper.plugin.internalName,
plugin.first pluginWrapper.repositoryData.url
) )
val (success, message) = if (file.exists()) { val (success, message) = if (file.exists()) {
PluginManager.deletePlugin(file) to R.string.plugin_deleted PluginManager.deletePlugin(file) to R.string.plugin_deleted
} else { } else {
val isEnabled = plugin.second.status != PROVIDER_STATUS_DOWN val isEnabled = pluginWrapper.plugin.status != PROVIDER_STATUS_DOWN
val message = if (isEnabled) R.string.plugin_loaded else R.string.plugin_downloaded val message = if (isEnabled) R.string.plugin_loaded else R.string.plugin_downloaded
PluginManager.downloadPlugin( PluginManager.downloadPlugin(
activity, activity,
metadata.url, metadata.url,
metadata.fileHash, metadata.fileHash,
metadata.internalName, metadata.internalName,
repo, repositoryData.url,
isEnabled isEnabled
) to message ) to message
} }
@ -201,20 +200,20 @@ class PluginsViewModel : ViewModel() {
updatePluginListPrivate(activity, repositoryUrls) updatePluginListPrivate(activity, repositoryUrls)
} }
private suspend fun updatePluginListPrivate(context: Context, repositoryUrls: List<String>) { private suspend fun updatePluginListPrivate(context: Context, repositories: List<RepositoryData>) {
val isAdult = PreferenceManager.getDefaultSharedPreferences(context) val isAdult = PreferenceManager.getDefaultSharedPreferences(context)
.getStringSet(context.getString(R.string.prefer_media_type_key), emptySet()) .getStringSet(context.getString(R.string.prefer_media_type_key), emptySet())
?.contains(TvType.NSFW.ordinal.toString()) == true ?.contains(TvType.NSFW.ordinal.toString()) == true
val plugins = repositoryUrls.flatMap { repositoryUrl -> val plugins = repositories.flatMap { repositoryUrl ->
getPlugins(repositoryUrl) getPlugins(repositoryUrl)
} }
val list = plugins.filter { val list = plugins.filter {
// Show all non-nsfw plugins or all if nsfw is enabled // Show all non-nsfw plugins or all if nsfw is enabled
it.second.tvTypes?.contains(TvType.NSFW.name) != true || isAdult it.plugin.tvTypes?.contains(TvType.NSFW.name) != true || isAdult
}.map { plugin -> }.map { plugin ->
PluginViewData(plugin, isDownloaded(context, plugin.second.internalName, plugin.first)) PluginViewData(plugin, isDownloaded(context, plugin.plugin.internalName, plugin.repositoryData.url))
} }
this.plugins = list this.plugins = list
@ -227,8 +226,8 @@ class PluginsViewModel : ViewModel() {
private fun List<PluginViewData>.filterTvTypes(): List<PluginViewData> { private fun List<PluginViewData>.filterTvTypes(): List<PluginViewData> {
if (tvTypes.isEmpty()) return this if (tvTypes.isEmpty()) return this
return this.filter { return this.filter {
(it.plugin.second.tvTypes?.any { type -> tvTypes.contains(type) } == true) || (it.pluginWrapper.plugin.tvTypes?.any { type -> tvTypes.contains(type) } == true) ||
(tvTypes.contains(TvType.Others.name) && (it.plugin.second.tvTypes (tvTypes.contains(TvType.Others.name) && (it.pluginWrapper.plugin.tvTypes
?: emptyList()).isEmpty()) ?: emptyList()).isEmpty())
} }
} }
@ -236,26 +235,26 @@ class PluginsViewModel : ViewModel() {
private fun List<PluginViewData>.filterLang(): List<PluginViewData> { private fun List<PluginViewData>.filterLang(): List<PluginViewData> {
if (selectedLanguages.isEmpty()) return this // do not filter if (selectedLanguages.isEmpty()) return this // do not filter
return this.filter { return this.filter {
if (it.plugin.second.language == null) { if (it.pluginWrapper.plugin.language == null) {
return@filter selectedLanguages.contains("none") return@filter selectedLanguages.contains("none")
} }
selectedLanguages.contains(it.plugin.second.language?.lowercase()) selectedLanguages.contains(it.pluginWrapper.plugin.language.lowercase())
} }
} }
private fun List<PluginViewData>.sortByQuery(query: String?): List<PluginViewData> { private fun List<PluginViewData>.sortByQuery(query: String?): List<PluginViewData> {
return if (query.isNullOrBlank()) { return if (query.isNullOrBlank()) {
// Return list to base state if no query // Return list to base state if no query
this.sortedBy { it.plugin.second.name } this.sortedBy { it.pluginWrapper.plugin.name }
} else { } else {
this.mapNotNull { this.mapNotNull {
// Try matching name // Try matching name
val score = Levenshtein.partialRatio( val score = Levenshtein.partialRatio(
it.plugin.second.name.lowercase(), it.pluginWrapper.plugin.name.lowercase(),
query.lowercase() query.lowercase()
).takeIf { score -> score > 80 } ?: ).takeIf { score -> score > 80 } ?:
// Fallback to description, but limit characters to reduce lag // Fallback to description, but limit characters to reduce lag
it.plugin.second.description?.lowercase()?.take(64) it.pluginWrapper.plugin.description?.lowercase()?.take(64)
?.let { description -> ?.let { description ->
Levenshtein.partialRatio( Levenshtein.partialRatio(
description, description,
@ -282,11 +281,11 @@ class PluginsViewModel : ViewModel() {
) )
} }
fun updatePluginList(context: Context?, repositoryUrls: List<String>) = fun updatePluginList(context: Context?, repositories: List<RepositoryData>) =
viewModelScope.launchSafe { viewModelScope.launchSafe {
if (context == null) return@launchSafe if (context == null) return@launchSafe
Log.i(TAG, "updatePluginList = $repositoryUrls") Log.i(TAG, "updatePluginList = $repositories")
updatePluginListPrivate(context, repositoryUrls) updatePluginListPrivate(context, repositories)
} }
fun search(query: String?) { fun search(query: String?) {
@ -305,7 +304,7 @@ class PluginsViewModel : ViewModel() {
val downloadedPlugins = (PluginManager.getPluginsOnline() + PluginManager.getPluginsLocal()) val downloadedPlugins = (PluginManager.getPluginsOnline() + PluginManager.getPluginsLocal())
.distinctBy { it.filePath } .distinctBy { it.filePath }
.map { .map {
PluginViewData("" to it.toSitePlugin(), true) PluginViewData(PluginWrapper.getLocalPluginWrapper(it.toSitePlugin()), true)
} }
plugins = downloadedPlugins plugins = downloadedPlugins

View file

@ -56,7 +56,7 @@ class SetupFragmentExtensions : BaseFragment<FragmentSetupExtensionsBinding>(
if (hasRepos) { if (hasRepos) {
binding?.repoRecyclerView?.adapter = RepoAdapter(true, {}, { binding?.repoRecyclerView?.adapter = RepoAdapter(true, {}, {
PluginsViewModel.downloadAll(activity, it.url, null) PluginsViewModel.downloadAll(activity, it, null)
}).apply { submitList(repositories.toList()) } }).apply { submitList(repositories.toList()) }
} }
// else { // else {

View file

@ -101,7 +101,7 @@ class ChromecastSubtitlesFragment : BaseFragment<ChromecastSubtitleSettingsBindi
} }
fun getCurrentSavedStyle(): SaveChromeCaptionStyle { fun getCurrentSavedStyle(): SaveChromeCaptionStyle {
return getKey(CHROME_SUBTITLE_KEY) ?: defaultState return getKey<SaveChromeCaptionStyle>(CHROME_SUBTITLE_KEY) ?: defaultState
} }
private val defaultState = SaveChromeCaptionStyle() private val defaultState = SaveChromeCaptionStyle()

View file

@ -115,6 +115,9 @@ class SubtitlesFragment : BaseDialogFragment<SubtitleSettingsBinding>(
) )
} }
view.clipToPadding = false
view.clipChildren = false
// we default to 25sp, this is needed as RoundedBackgroundColorSpan breaks on override sizes // we default to 25sp, this is needed as RoundedBackgroundColorSpan breaks on override sizes
val size = data.fixedTextSize ?: 25.0f val size = data.fixedTextSize ?: 25.0f
view.setFixedTextSize(TypedValue.COMPLEX_UNIT_SP, size) view.setFixedTextSize(TypedValue.COMPLEX_UNIT_SP, size)
@ -261,7 +264,7 @@ class SubtitlesFragment : BaseDialogFragment<SubtitleSettingsBinding>(
} }
fun getCurrentSavedStyle(): SaveCaptionStyle { fun getCurrentSavedStyle(): SaveCaptionStyle {
return cachedSubtitleStyle ?: (getKey(SUBTITLE_KEY) ?: SaveCaptionStyle( return cachedSubtitleStyle ?: (getKey<SaveCaptionStyle>(SUBTITLE_KEY) ?: SaveCaptionStyle(
foregroundColor = getDefColor(0), foregroundColor = getDefColor(0),
backgroundColor = getDefColor(2), backgroundColor = getDefColor(2),
windowColor = getDefColor(3), windowColor = getDefColor(3),
@ -293,11 +296,11 @@ class SubtitlesFragment : BaseDialogFragment<SubtitleSettingsBinding>(
} }
fun getDownloadSubsLanguageTagIETF(): List<String> { fun getDownloadSubsLanguageTagIETF(): List<String> {
return getKey(SUBTITLE_DOWNLOAD_KEY) ?: listOf("en") return getKey<List<String>>(SUBTITLE_DOWNLOAD_KEY) ?: listOf("en")
} }
fun getAutoSelectLanguageTagIETF(): String { fun getAutoSelectLanguageTagIETF(): String {
return getKey(SUBTITLE_AUTO_SELECT_KEY) ?: "en" return getKey<String>(SUBTITLE_AUTO_SELECT_KEY) ?: "en"
} }
} }

View file

@ -90,12 +90,9 @@ import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.sync.withLock
import okhttp3.Cache import okhttp3.Cache
import java.io.File import java.io.File
import java.net.URL
import java.net.URLDecoder
import java.util.concurrent.Executor import java.util.concurrent.Executor
import java.util.concurrent.Executors import java.util.concurrent.Executors
object AppContextUtils { object AppContextUtils {
fun RecyclerView.isRecyclerScrollable(): Boolean { fun RecyclerView.isRecyclerScrollable(): Boolean {
val layoutManager = val layoutManager =
@ -147,6 +144,7 @@ object AppContextUtils {
text.toSpanned() text.toSpanned()
} }
} }
/** Get channel ID by name */ /** Get channel ID by name */
@SuppressLint("RestrictedApi") @SuppressLint("RestrictedApi")
private fun buildWatchNextProgramUri( private fun buildWatchNextProgramUri(
@ -364,15 +362,22 @@ object AppContextUtils {
} }
} }
/** Sort subtitles by names */
fun sortSubs(subs: Set<SubtitleData>): List<SubtitleData> { fun sortSubs(subs: Set<SubtitleData>): List<SubtitleData> {
return subs.sortedBy { it.name } // Be aware, sorting by "$originalName $nameSuffix" causes "a (b) 1" < "a 1",
// where "originalName then nameSuffix" preserves "a 1" < "a (b) 1", because we do not compare '(' and '1'.
return subs
.sortedWith(
compareBy { subtitle: SubtitleData -> subtitle.originalName }
.thenBy { subtitle: SubtitleData -> subtitle.nameSuffix })
} }
fun Context.getApiSettings(): HashSet<String> { fun Context.getApiSettings(): HashSet<String> {
val hashSet = HashSet<String>() val hashSet = HashSet<String>()
val activeLangs = getApiProviderLangSettings() val activeLangs = getApiProviderLangSettings()
val hasUniversal = activeLangs.contains(AllLanguagesName) val hasUniversal = activeLangs.contains(AllLanguagesName)
hashSet.addAll(apis.filter { hasUniversal || activeLangs.contains(it.lang) }.map { it.name }) hashSet.addAll(apis.filter { hasUniversal || activeLangs.contains(it.lang) }
.map { it.name })
return hashSet return hashSet
} }
@ -463,7 +468,8 @@ object AppContextUtils {
} ?: default } ?: default
val langs = this.getApiProviderLangSettings() val langs = this.getApiProviderLangSettings()
val hasUniversal = langs.contains(AllLanguagesName) val hasUniversal = langs.contains(AllLanguagesName)
val allApis = apis.filter { api -> (hasUniversal || langs.contains(api.lang)) && (api.hasMainPage || !hasHomePageIsRequired) } val allApis =
apis.filter { api -> (hasUniversal || langs.contains(api.lang)) && (api.hasMainPage || !hasHomePageIsRequired) }
return if (currentPrefMedia.isEmpty()) { return if (currentPrefMedia.isEmpty()) {
allApis allApis
} else { } else {
@ -517,13 +523,12 @@ object AppContextUtils {
fun Activity.loadRepository(url: String) { fun Activity.loadRepository(url: String) {
ioSafe { ioSafe {
val repo = RepositoryManager.parseRepository(url) ?: return@ioSafe val repo = RepositoryManager.parseRepository(url) ?: return@ioSafe
RepositoryManager.addRepository( val data = RepositoryData(
RepositoryData(
repo.iconUrl ?: "", repo.iconUrl ?: "",
repo.name, repo.name,
url url
) )
) RepositoryManager.addRepository(data)
main { main {
showToast( showToast(
getString(R.string.player_loaded_subtitles, repo.name), getString(R.string.player_loaded_subtitles, repo.name),
@ -531,13 +536,12 @@ object AppContextUtils {
) )
} }
afterRepositoryLoadedEvent.invoke(true) afterRepositoryLoadedEvent.invoke(true)
addRepositoryDialog(repo.name, url) addRepositoryDialog(data)
} }
} }
fun Activity.addRepositoryDialog( fun Activity.addRepositoryDialog(
repositoryName: String, repositoryData: RepositoryData
repositoryURL: String,
) { ) {
val repos = RepositoryManager.getRepositories() val repos = RepositoryManager.getRepositories()
@ -547,9 +551,7 @@ object AppContextUtils {
navigate( navigate(
R.id.global_to_navigation_settings_plugins, R.id.global_to_navigation_settings_plugins,
PluginsFragment.newInstance( PluginsFragment.newInstance(
repositoryName, repositoryData,
repositoryURL,
false,
) )
) )
} }
@ -557,7 +559,7 @@ object AppContextUtils {
runOnUiThread { runOnUiThread {
AlertDialog.Builder(this).apply { AlertDialog.Builder(this).apply {
setTitle(repositoryName) setTitle(repositoryData.name)
setMessage(R.string.download_all_plugins_from_repo) setMessage(R.string.download_all_plugins_from_repo)
setPositiveButton(R.string.open_downloaded_repo) { _, _ -> setPositiveButton(R.string.open_downloaded_repo) { _, _ ->
openAddedRepo() openAddedRepo()
@ -630,16 +632,17 @@ object AppContextUtils {
} }
} }
fun splitQuery(url: URL): Map<String, String> { // Deprecate after next stable
val queryPairs: MutableMap<String, String> = LinkedHashMap() /* @Deprecated(
val query: String = url.query message = "Use splitUrlParameters instead.",
val pairs = query.split("&").toTypedArray() replaceWith = ReplaceWith(
for (pair in pairs) { expression = "splitUrlParameters(url.toString())",
val idx = pair.indexOf("=") imports = ["com.lagradost.cloudstream3.splitUrlParameters"],
queryPairs[URLDecoder.decode(pair.substring(0, idx), "UTF-8")] = ),
URLDecoder.decode(pair.substring(idx + 1), "UTF-8") level = DeprecationLevel.WARNING,
} ) */
return queryPairs fun splitQuery(url: java.net.URL): Map<String, String> {
return com.lagradost.cloudstream3.splitUrlParameters(url.toString())
} }
/**| S1:E2 Hello World /**| S1:E2 Hello World
@ -843,7 +846,8 @@ object AppContextUtils {
} }
fun Context.isUsingMobileData(): Boolean { fun Context.isUsingMobileData(): Boolean {
val connectionManager = getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager val connectionManager =
getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val activeNetwork: Network? = connectionManager.activeNetwork val activeNetwork: Network? = connectionManager.activeNetwork
val networkCapabilities = connectionManager.getNetworkCapabilities(activeNetwork) val networkCapabilities = connectionManager.getNetworkCapabilities(activeNetwork)

View file

@ -181,11 +181,11 @@ object DataStore {
} }
fun <T : Any> Context.getKey(path: String, valueType: Class<T>): T? { fun <T : Any> Context.getKey(path: String, valueType: Class<T>): T? {
try { return try {
val json: String = getSharedPrefs().getString(path, null) ?: return null val json: String = getSharedPrefs().getString(path, null) ?: return null
return parseJson(json, valueType.kotlin) parseJson(json, valueType.kotlin)
} catch (e: Exception) { } catch (_: Exception) {
return null null
} }
} }
@ -193,21 +193,37 @@ object DataStore {
setKey(getFolderName(folder, path), value) setKey(getFolderName(folder, path), value)
} }
@Deprecated(
message = "Use parseJson<T>(this) directly instead.",
level = DeprecationLevel.WARNING,
replaceWith = ReplaceWith(
expression = "parseJson<T>(this)",
imports = ["com.lagradost.cloudstream3.utils.AppUtils.parseJson"],
),
)
inline fun <reified T : Any> String.toKotlinObject(): T { inline fun <reified T : Any> String.toKotlinObject(): T {
return parseJson(this) return parseJson(this)
} }
@Deprecated(
message = "Use parseJson<T>(this) directly instead.",
level = DeprecationLevel.WARNING,
replaceWith = ReplaceWith(
expression = "parseJson<T>(this)",
imports = ["com.lagradost.cloudstream3.utils.AppUtils.parseJson"],
),
)
fun <T : Any> String.toKotlinObject(valueType: Class<T>): T { fun <T : Any> String.toKotlinObject(valueType: Class<T>): T {
return parseJson(this, valueType.kotlin) return parseJson(this, valueType.kotlin)
} }
// GET KEY GIVEN PATH AND DEFAULT VALUE, NULL IF ERROR // GET KEY GIVEN PATH AND DEFAULT VALUE, NULL IF ERROR
inline fun <reified T : Any> Context.getKey(path: String, defVal: T?): T? { inline fun <reified T : Any> Context.getKey(path: String, defVal: T?): T? {
try { return try {
val json: String = getSharedPrefs().getString(path, null) ?: return defVal val json: String = getSharedPrefs().getString(path, null) ?: return defVal
return json.toKotlinObject() parseJson<T>(json)
} catch (e: Exception) { } catch (_: Exception) {
return null null
} }
} }

View file

@ -1,6 +1,7 @@
package com.lagradost.cloudstream3.utils package com.lagradost.cloudstream3.utils
import android.content.Context import android.content.Context
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.APIHolder.unixTimeMS import com.lagradost.cloudstream3.APIHolder.unixTimeMS
import com.lagradost.cloudstream3.CloudStreamApp.Companion.context import com.lagradost.cloudstream3.CloudStreamApp.Companion.context
@ -31,6 +32,12 @@ import com.lagradost.cloudstream3.ui.result.ResultEpisode
import com.lagradost.cloudstream3.ui.result.VideoWatchState import com.lagradost.cloudstream3.ui.result.VideoWatchState
import com.lagradost.cloudstream3.utils.AppContextUtils.filterProviderByPreferredMedia import com.lagradost.cloudstream3.utils.AppContextUtils.filterProviderByPreferredMedia
import com.lagradost.cloudstream3.utils.downloader.DownloadObjects import com.lagradost.cloudstream3.utils.downloader.DownloadObjects
import com.lagradost.cloudstream3.utils.serializers.WriteOnlySerializer
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.KeepGeneratedSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient
import java.util.Calendar import java.util.Calendar
import java.util.Date import java.util.Date
import java.util.GregorianCalendar import java.util.GregorianCalendar
@ -43,17 +50,18 @@ const val RESULT_WATCH_STATE = "result_watch_state"
const val RESULT_WATCH_STATE_DATA = "result_watch_state_data" const val RESULT_WATCH_STATE_DATA = "result_watch_state_data"
const val RESULT_SUBSCRIBED_STATE_DATA = "result_subscribed_state_data" const val RESULT_SUBSCRIBED_STATE_DATA = "result_subscribed_state_data"
const val RESULT_FAVORITES_STATE_DATA = "result_favorites_state_data" const val RESULT_FAVORITES_STATE_DATA = "result_favorites_state_data"
const val RESULT_RESUME_WATCHING = "result_resume_watching_2" // changed due to id changes const val RESULT_RESUME_WATCHING = "result_resume_watching_2" // Changed due to id changes
const val RESULT_RESUME_WATCHING_OLD = "result_resume_watching" const val RESULT_RESUME_WATCHING_OLD = "result_resume_watching"
const val RESULT_RESUME_WATCHING_HAS_MIGRATED = "result_resume_watching_migrated" const val RESULT_RESUME_WATCHING_HAS_MIGRATED = "result_resume_watching_migrated"
const val RESULT_EPISODE = "result_episode" const val RESULT_EPISODE = "result_episode"
const val RESULT_SEASON = "result_season" const val RESULT_SEASON = "result_season"
const val RESULT_DUB = "result_dub" const val RESULT_DUB = "result_dub"
const val KEY_RESULT_SORT = "result_sort" const val KEY_RESULT_SORT = "result_sort"
const val USER_PINNED_PROVIDERS = "user_pinned_providers" //key for pinned user set const val USER_PINNED_PROVIDERS = "user_pinned_providers" // Key for pinned user set
class UserPreferenceDelegate<T : Any>( class UserPreferenceDelegate<T : Any>(
private val key: String, private val default: T //, private val klass: KClass<T> private val key: String,
private val default: T,
) { ) {
private val klass: KClass<out T> = default::class private val klass: KClass<out T> = default::class
private val realKey get() = "${DataStoreHelper.currentAccount}/$key" private val realKey get() = "${DataStoreHelper.currentAccount}/$key"
@ -63,7 +71,7 @@ class UserPreferenceDelegate<T : Any>(
operator fun setValue( operator fun setValue(
self: Any?, self: Any?,
property: KProperty<*>, property: KProperty<*>,
t: T? t: T?,
) { ) {
if (t == null) { if (t == null) {
removeKey(realKey) removeKey(realKey)
@ -82,7 +90,7 @@ object DataStoreHelper {
R.drawable.profile_bg_pink, R.drawable.profile_bg_pink,
R.drawable.profile_bg_purple, R.drawable.profile_bg_purple,
R.drawable.profile_bg_red, R.drawable.profile_bg_red,
R.drawable.profile_bg_teal R.drawable.profile_bg_teal,
) )
private var searchPreferenceProvidersStrings: List<String> by UserPreferenceDelegate( private var searchPreferenceProvidersStrings: List<String> by UserPreferenceDelegate(
@ -112,16 +120,17 @@ object DataStoreHelper {
private var searchPreferenceTagsStrings: List<String> by UserPreferenceDelegate( private var searchPreferenceTagsStrings: List<String> by UserPreferenceDelegate(
"search_pref_tags", "search_pref_tags",
listOf(TvType.Movie, TvType.TvSeries).map { it.name }) listOf(TvType.Movie, TvType.TvSeries).map { it.name })
var searchPreferenceTags: List<TvType> var searchPreferenceTags: List<TvType>
get() = deserializeTv(searchPreferenceTagsStrings) get() = deserializeTv(searchPreferenceTagsStrings)
set(value) { set(value) {
searchPreferenceTagsStrings = serializeTv(value) searchPreferenceTagsStrings = serializeTv(value)
} }
private var homePreferenceStrings: List<String> by UserPreferenceDelegate( private var homePreferenceStrings: List<String> by UserPreferenceDelegate(
"home_pref_homepage", "home_pref_homepage",
listOf(TvType.Movie, TvType.TvSeries).map { it.name }) listOf(TvType.Movie, TvType.TvSeries).map { it.name })
var homePreference: List<TvType> var homePreference: List<TvType>
get() = deserializeTv(homePreferenceStrings) get() = deserializeTv(homePreferenceStrings)
set(value) { set(value) {
@ -132,38 +141,38 @@ object DataStoreHelper {
"home_bookmarked_last_list", "home_bookmarked_last_list",
IntArray(0) IntArray(0)
) )
var playBackSpeed: Float by UserPreferenceDelegate("playback_speed", 1.0f) var playBackSpeed: Float by UserPreferenceDelegate("playback_speed", 1.0f)
var resizeMode: Int by UserPreferenceDelegate("resize_mode", 0) var resizeMode: Int by UserPreferenceDelegate("resize_mode", 0)
var librarySortingMode: Int by UserPreferenceDelegate( var librarySortingMode: Int by UserPreferenceDelegate(
"library_sorting_mode", "library_sorting_mode",
ListSorting.AlphabeticalA.ordinal ListSorting.AlphabeticalA.ordinal
) )
private var _resultsSortingMode: Int by UserPreferenceDelegate( private var _resultsSortingMode: Int by UserPreferenceDelegate(
"results_sorting_mode", "results_sorting_mode",
EpisodeSortType.NUMBER_ASC.ordinal EpisodeSortType.NUMBER_ASC.ordinal
) )
var resultsSortingMode: EpisodeSortType var resultsSortingMode: EpisodeSortType
get() = EpisodeSortType.entries.getOrNull(_resultsSortingMode) ?: EpisodeSortType.NUMBER_ASC get() = EpisodeSortType.entries.getOrNull(_resultsSortingMode) ?: EpisodeSortType.NUMBER_ASC
set(value) { set(value) {
_resultsSortingMode = value.ordinal _resultsSortingMode = value.ordinal
} }
@Serializable
data class Account( data class Account(
@JsonProperty("keyIndex") @JsonProperty("keyIndex") @SerialName("keyIndex") val keyIndex: Int,
val keyIndex: Int, @JsonProperty("name") @SerialName("name") val name: String,
@JsonProperty("name") @JsonProperty("customImage") @SerialName("customImage") val customImage: String? = null,
val name: String, @JsonProperty("defaultImageIndex") @SerialName("defaultImageIndex") val defaultImageIndex: Int,
@JsonProperty("customImage") @JsonProperty("lockPin") @SerialName("lockPin") val lockPin: String? = null,
val customImage: String? = null,
@JsonProperty("defaultImageIndex")
val defaultImageIndex: Int,
@JsonProperty("lockPin")
val lockPin: String? = null,
) { ) {
val image @get:JsonIgnore
get() = customImage?.let { UiImage.Image(it) } ?: profileImages.getOrNull( val image get() = customImage?.let { UiImage.Image(it) } ?:
defaultImageIndex profileImages.getOrNull(defaultImageIndex)?.let {
)?.let { UiImage.Drawable(it) } ?: UiImage.Drawable(profileImages.first()) UiImage.Drawable(it)
} ?: UiImage.Drawable(profileImages.first())
} }
const val TAG = "data_store_helper" const val TAG = "data_store_helper"
@ -176,7 +185,7 @@ object DataStoreHelper {
* Setting this does not automatically reload the homepage. * Setting this does not automatically reload the homepage.
*/ */
var currentHomePage: String? var currentHomePage: String?
get() = getKey("$currentAccount/$USER_SELECTED_HOMEPAGE_API") get() = getKey<String>("$currentAccount/$USER_SELECTED_HOMEPAGE_API")
set(value) { set(value) {
val key = "$currentAccount/$USER_SELECTED_HOMEPAGE_API" val key = "$currentAccount/$USER_SELECTED_HOMEPAGE_API"
if (value == null) { if (value == null) {
@ -188,7 +197,6 @@ object DataStoreHelper {
fun setAccount(account: Account) { fun setAccount(account: Account) {
val homepage = currentHomePage val homepage = currentHomePage
selectedKeyIndex = account.keyIndex selectedKeyIndex = account.keyIndex
AccountManager.updateAccountIds() AccountManager.updateAccountIds()
showToast(context?.getString(R.string.logged_account, account.name) ?: account.name) showToast(context?.getString(R.string.logged_account, account.name) ?: account.name)
@ -206,7 +214,7 @@ object DataStoreHelper {
currentAccounts.getOrNull(currentAccounts.indexOfFirst { it.keyIndex == 0 }) ?: Account( currentAccounts.getOrNull(currentAccounts.indexOfFirst { it.keyIndex == 0 }) ?: Account(
keyIndex = 0, keyIndex = 0,
name = context.getString(R.string.default_account), name = context.getString(R.string.default_account),
defaultImageIndex = 0 defaultImageIndex = 0,
) )
} }
} }
@ -232,18 +240,21 @@ object DataStoreHelper {
} }
} }
@Serializable
data class PosDur( data class PosDur(
@JsonProperty("position") val position: Long, @JsonProperty("position") @SerialName("position") val position: Long,
@JsonProperty("duration") val duration: Long @JsonProperty("duration") @SerialName("duration") val duration: Long,
) )
fun PosDur.fixVisual(): PosDur { fun PosDur.fixVisual(): PosDur {
if (duration <= 0) return PosDur(0, duration) if (duration <= 0) return PosDur(0, duration)
val percentage = position * 100 / duration val percentage = position * 100 / duration
if (percentage <= 1) return PosDur(0, duration) return when {
if (percentage <= 5) return PosDur(5 * duration / 100, duration) percentage <= 1 -> PosDur(0, duration)
if (percentage >= 95) return PosDur(duration, duration) percentage <= 5 -> PosDur(5 * duration / 100, duration)
return this percentage >= 95 -> PosDur(duration, duration)
else -> this
}
} }
fun Int.toYear(): Date = fun Int.toYear(): Date =
@ -251,28 +262,38 @@ object DataStoreHelper {
/** /**
* Used to display notifications on new episodes and posters in library. * Used to display notifications on new episodes and posters in library.
**/ */
@Serializable
abstract class LibrarySearchResponse( abstract class LibrarySearchResponse(
@JsonProperty("id") override var id: Int?, /**
@JsonProperty("latestUpdatedTime") open val latestUpdatedTime: Long, * These fields are marked @Transient because this class is only ever serialized through
@JsonProperty("name") override val name: String, * through its subclasses, which redeclare each property with their own @SerialName
@JsonProperty("url") override val url: String, * annotations. Without @Transient here, kotlinx.serialization would try to
@JsonProperty("apiName") override val apiName: String, * generate a serializer for the abstract base class itself (or double-serialize
@JsonProperty("type") override var type: TvType?, * these fields), which fails/conflicts since these are meant to be overridden,
@JsonProperty("posterUrl") override var posterUrl: String?, * not serialized directly from the parent.
@JsonProperty("year") open val year: Int?, */
@JsonProperty("syncData") open val syncData: Map<String, String>?, @Transient override var id: Int? = null,
@JsonProperty("quality") override var quality: SearchQuality?, @Transient open val latestUpdatedTime: Long = 0L,
@JsonProperty("posterHeaders") override var posterHeaders: Map<String, String>?, @Transient override val name: String = "",
@JsonProperty("plot") open val plot: String? = null, @Transient override val url: String = "",
@JsonProperty("score") override var score: Score? = null, @Transient override val apiName: String = "",
@JsonProperty("tags") open val tags: List<String>? = null, @Transient override var type: TvType? = null,
@Transient override var posterUrl: String? = null,
@Transient open val year: Int? = null,
@Transient open val syncData: Map<String, String>? = null,
@Transient override var quality: SearchQuality? = null,
@Transient override var posterHeaders: Map<String, String>? = null,
@Transient open val plot: String? = null,
@Transient override var score: Score? = null,
@Transient open val tags: List<String>? = null,
) : SearchResponse { ) : SearchResponse {
@JsonProperty("rating", access = JsonProperty.Access.WRITE_ONLY) @JsonProperty("rating", access = JsonProperty.Access.WRITE_ONLY)
@SerialName("rating")
@Deprecated( @Deprecated(
"`rating` is the old scoring system, use score instead", "`rating` is the old scoring system, use score instead",
replaceWith = ReplaceWith("score"), replaceWith = ReplaceWith("score"),
level = DeprecationLevel.ERROR level = DeprecationLevel.ERROR,
) )
var rating: Int? = null var rating: Int? = null
set(value) { set(value) {
@ -283,23 +304,26 @@ object DataStoreHelper {
} }
} }
@OptIn(ExperimentalSerializationApi::class) // KeepGeneratedSerializer is an experimental annotation for now
@KeepGeneratedSerializer
@Serializable(with = SubscribedData.Serializer::class)
data class SubscribedData( data class SubscribedData(
@JsonProperty("subscribedTime") val subscribedTime: Long, @JsonProperty("subscribedTime") @SerialName("subscribedTime") val subscribedTime: Long,
@JsonProperty("lastSeenEpisodeCount") val lastSeenEpisodeCount: Map<DubStatus, Int?>, @JsonProperty("lastSeenEpisodeCount") @SerialName("lastSeenEpisodeCount") val lastSeenEpisodeCount: Map<DubStatus, Int?>,
override var id: Int?, @JsonProperty("id") @SerialName("id") override var id: Int?,
override val latestUpdatedTime: Long, @JsonProperty("latestUpdatedTime") @SerialName("latestUpdatedTime") override val latestUpdatedTime: Long,
override val name: String, @JsonProperty("name") @SerialName("name") override val name: String,
override val url: String, @JsonProperty("url") @SerialName("url") override val url: String,
override val apiName: String, @JsonProperty("apiName") @SerialName("apiName") override val apiName: String,
override var type: TvType?, @JsonProperty("type") @SerialName("type") override var type: TvType?,
override var posterUrl: String?, @JsonProperty("posterUrl") @SerialName("posterUrl") override var posterUrl: String?,
override val year: Int?, @JsonProperty("year") @SerialName("year") override val year: Int?,
override val syncData: Map<String, String>? = null, @JsonProperty("syncData") @SerialName("syncData") override val syncData: Map<String, String>? = null,
override var quality: SearchQuality? = null, @JsonProperty("quality") @SerialName("quality") override var quality: SearchQuality? = null,
override var posterHeaders: Map<String, String>? = null, @JsonProperty("posterHeaders") @SerialName("posterHeaders") override var posterHeaders: Map<String, String>? = null,
override val plot: String? = null, @JsonProperty("plot") @SerialName("plot") override val plot: String? = null,
override var score: Score? = null, @JsonProperty("score") @SerialName("score") override var score: Score? = null,
override val tags: List<String>? = null, @JsonProperty("tags") @SerialName("tags") override val tags: List<String>? = null,
) : LibrarySearchResponse( ) : LibrarySearchResponse(
id, id,
latestUpdatedTime, latestUpdatedTime,
@ -314,8 +338,13 @@ object DataStoreHelper {
posterHeaders, posterHeaders,
plot, plot,
score, score,
tags tags,
) { ) {
object Serializer : WriteOnlySerializer<SubscribedData>(
SubscribedData.generatedSerializer(),
setOf("rating"),
)
fun toLibraryItem(): SyncAPI.LibraryItem? { fun toLibraryItem(): SyncAPI.LibraryItem? {
return SyncAPI.LibraryItem( return SyncAPI.LibraryItem(
name, name,
@ -334,27 +363,30 @@ object DataStoreHelper {
this.id, this.id,
plot = this.plot, plot = this.plot,
score = this.score, score = this.score,
tags = this.tags tags = this.tags,
) )
} }
} }
@OptIn(ExperimentalSerializationApi::class) // KeepGeneratedSerializer is an experimental annotation for now
@KeepGeneratedSerializer
@Serializable(with = BookmarkedData.Serializer::class)
data class BookmarkedData( data class BookmarkedData(
@JsonProperty("bookmarkedTime") val bookmarkedTime: Long, @JsonProperty("bookmarkedTime") @SerialName("bookmarkedTime") val bookmarkedTime: Long,
override var id: Int?, @JsonProperty("id") @SerialName("id") override var id: Int?,
override val latestUpdatedTime: Long, @JsonProperty("latestUpdatedTime") @SerialName("latestUpdatedTime") override val latestUpdatedTime: Long,
override val name: String, @JsonProperty("name") @SerialName("name") override val name: String,
override val url: String, @JsonProperty("url") @SerialName("url") override val url: String,
override val apiName: String, @JsonProperty("apiName") @SerialName("apiName") override val apiName: String,
override var type: TvType?, @JsonProperty("type") @SerialName("type") override var type: TvType?,
override var posterUrl: String?, @JsonProperty("posterUrl") @SerialName("posterUrl") override var posterUrl: String?,
override val year: Int?, @JsonProperty("year") @SerialName("year") override val year: Int?,
override val syncData: Map<String, String>? = null, @JsonProperty("syncData") @SerialName("syncData") override val syncData: Map<String, String>? = null,
override var quality: SearchQuality? = null, @JsonProperty("quality") @SerialName("quality") override var quality: SearchQuality? = null,
override var posterHeaders: Map<String, String>? = null, @JsonProperty("posterHeaders") @SerialName("posterHeaders") override var posterHeaders: Map<String, String>? = null,
override val plot: String? = null, @JsonProperty("plot") @SerialName("plot") override val plot: String? = null,
override var score: Score? = null, @JsonProperty("score") @SerialName("score") override var score: Score? = null,
override val tags: List<String>? = null, @JsonProperty("tags") @SerialName("tags") override val tags: List<String>? = null,
) : LibrarySearchResponse( ) : LibrarySearchResponse(
id, id,
latestUpdatedTime, latestUpdatedTime,
@ -367,8 +399,13 @@ object DataStoreHelper {
syncData, syncData,
quality, quality,
posterHeaders, posterHeaders,
plot plot,
) { ) {
object Serializer : WriteOnlySerializer<BookmarkedData>(
BookmarkedData.generatedSerializer(),
setOf("rating"),
)
fun toLibraryItem(id: String): SyncAPI.LibraryItem { fun toLibraryItem(id: String): SyncAPI.LibraryItem {
return SyncAPI.LibraryItem( return SyncAPI.LibraryItem(
name, name,
@ -387,27 +424,30 @@ object DataStoreHelper {
this.id, this.id,
plot = this.plot, plot = this.plot,
score = this.score, score = this.score,
tags = this.tags tags = this.tags,
) )
} }
} }
@OptIn(ExperimentalSerializationApi::class) // KeepGeneratedSerializer is an experimental annotation for now
@KeepGeneratedSerializer
@Serializable(with = FavoritesData.Serializer::class)
data class FavoritesData( data class FavoritesData(
@JsonProperty("favoritesTime") val favoritesTime: Long, @JsonProperty("favoritesTime") @SerialName("favoritesTime") val favoritesTime: Long,
override var id: Int?, @JsonProperty("id") @SerialName("id") override var id: Int?,
override val latestUpdatedTime: Long, @JsonProperty("latestUpdatedTime") @SerialName("latestUpdatedTime") override val latestUpdatedTime: Long,
override val name: String, @JsonProperty("name") @SerialName("name") override val name: String,
override val url: String, @JsonProperty("url") @SerialName("url") override val url: String,
override val apiName: String, @JsonProperty("apiName") @SerialName("apiName") override val apiName: String,
override var type: TvType?, @JsonProperty("type") @SerialName("type") override var type: TvType?,
override var posterUrl: String?, @JsonProperty("posterUrl") @SerialName("posterUrl") override var posterUrl: String?,
override val year: Int?, @JsonProperty("year") @SerialName("year") override val year: Int?,
override val syncData: Map<String, String>? = null, @JsonProperty("syncData") @SerialName("syncData") override val syncData: Map<String, String>? = null,
override var quality: SearchQuality? = null, @JsonProperty("quality") @SerialName("quality") override var quality: SearchQuality? = null,
override var posterHeaders: Map<String, String>? = null, @JsonProperty("posterHeaders") @SerialName("posterHeaders") override var posterHeaders: Map<String, String>? = null,
override val plot: String? = null, @JsonProperty("plot") @SerialName("plot") override val plot: String? = null,
override var score: Score? = null, @JsonProperty("score") @SerialName("score") override var score: Score? = null,
override val tags: List<String>? = null, @JsonProperty("tags") @SerialName("tags") override val tags: List<String>? = null,
) : LibrarySearchResponse( ) : LibrarySearchResponse(
id, id,
latestUpdatedTime, latestUpdatedTime,
@ -420,8 +460,13 @@ object DataStoreHelper {
syncData, syncData,
quality, quality,
posterHeaders, posterHeaders,
plot plot,
) { ) {
object Serializer : WriteOnlySerializer<FavoritesData>(
FavoritesData.generatedSerializer(),
setOf("rating"),
)
fun toLibraryItem(): SyncAPI.LibraryItem? { fun toLibraryItem(): SyncAPI.LibraryItem? {
return SyncAPI.LibraryItem( return SyncAPI.LibraryItem(
name, name,
@ -440,31 +485,32 @@ object DataStoreHelper {
this.id, this.id,
plot = this.plot, plot = this.plot,
score = this.score, score = this.score,
tags = this.tags tags = this.tags,
) )
} }
} }
@Serializable
data class ResumeWatchingResult( data class ResumeWatchingResult(
@JsonProperty("name") override val name: String, @JsonProperty("name") @SerialName("name") override val name: String,
@JsonProperty("url") override val url: String, @JsonProperty("url") @SerialName("url") override val url: String,
@JsonProperty("apiName") override val apiName: String, @JsonProperty("apiName") @SerialName("apiName") override val apiName: String,
@JsonProperty("type") override var type: TvType? = null, @JsonProperty("type") @SerialName("type") override var type: TvType? = null,
@JsonProperty("posterUrl") override var posterUrl: String?, @JsonProperty("posterUrl") @SerialName("posterUrl") override var posterUrl: String?,
@JsonProperty("watchPos") val watchPos: PosDur?, @JsonProperty("watchPos") @SerialName("watchPos") val watchPos: PosDur?,
@JsonProperty("id") override var id: Int?, @JsonProperty("id") @SerialName("id") override var id: Int?,
@JsonProperty("parentId") val parentId: Int?, @JsonProperty("parentId") @SerialName("parentId") val parentId: Int?,
@JsonProperty("episode") val episode: Int?, @JsonProperty("episode") @SerialName("episode") val episode: Int?,
@JsonProperty("season") val season: Int?, @JsonProperty("season") @SerialName("season") val season: Int?,
@JsonProperty("isFromDownload") val isFromDownload: Boolean, @JsonProperty("isFromDownload") @SerialName("isFromDownload") val isFromDownload: Boolean,
@JsonProperty("quality") override var quality: SearchQuality? = null, @JsonProperty("quality") @SerialName("quality") override var quality: SearchQuality? = null,
@JsonProperty("posterHeaders") override var posterHeaders: Map<String, String>? = null, @JsonProperty("posterHeaders") @SerialName("posterHeaders") override var posterHeaders: Map<String, String>? = null,
@JsonProperty("score") override var score: Score? = null, @JsonProperty("score") @SerialName("score") override var score: Score? = null,
) : SearchResponse ) : SearchResponse
/** /**
* A datastore wide account for future implementations of a multiple account system * A datastore wide account for future implementations of a multiple account system
**/ */
fun getAllWatchStateIds(): List<Int>? { fun getAllWatchStateIds(): List<Int>? {
val folder = "$currentAccount/$RESULT_WATCH_STATE" val folder = "$currentAccount/$RESULT_WATCH_STATE"
@ -500,7 +546,7 @@ object DataStoreHelper {
} }
fun migrateResumeWatching() { fun migrateResumeWatching() {
// if (getKey(RESULT_RESUME_WATCHING_HAS_MIGRATED, false) != true) { // if (getKey<Boolean>(RESULT_RESUME_WATCHING_HAS_MIGRATED, false) != true) {
setKey(RESULT_RESUME_WATCHING_HAS_MIGRATED, true) setKey(RESULT_RESUME_WATCHING_HAS_MIGRATED, true)
getAllResumeStateIdsOld()?.forEach { id -> getAllResumeStateIdsOld()?.forEach { id ->
getLastWatchedOld(id)?.let { getLastWatchedOld(id)?.let {
@ -510,7 +556,7 @@ object DataStoreHelper {
it.episode, it.episode,
it.season, it.season,
it.isFromDownload, it.isFromDownload,
it.updateTime it.updateTime,
) )
removeLastWatchedOld(it.parentId) removeLastWatchedOld(it.parentId)
} }
@ -536,7 +582,7 @@ object DataStoreHelper {
episode, episode,
season, season,
updateTime ?: System.currentTimeMillis(), updateTime ?: System.currentTimeMillis(),
isFromDownload isFromDownload,
) )
) )
} }
@ -553,7 +599,7 @@ object DataStoreHelper {
fun getLastWatched(id: Int?): DownloadObjects.ResumeWatching? { fun getLastWatched(id: Int?): DownloadObjects.ResumeWatching? {
if (id == null) return null if (id == null) return null
return getKey( return getKey<DownloadObjects.ResumeWatching>(
"$currentAccount/$RESULT_RESUME_WATCHING", "$currentAccount/$RESULT_RESUME_WATCHING",
id.toString(), id.toString(),
) )
@ -561,7 +607,7 @@ object DataStoreHelper {
private fun getLastWatchedOld(id: Int?): DownloadObjects.ResumeWatching? { private fun getLastWatchedOld(id: Int?): DownloadObjects.ResumeWatching? {
if (id == null) return null if (id == null) return null
return getKey( return getKey<DownloadObjects.ResumeWatching>(
"$currentAccount/$RESULT_RESUME_WATCHING_OLD", "$currentAccount/$RESULT_RESUME_WATCHING_OLD",
id.toString(), id.toString(),
) )
@ -575,18 +621,18 @@ object DataStoreHelper {
fun getBookmarkedData(id: Int?): BookmarkedData? { fun getBookmarkedData(id: Int?): BookmarkedData? {
if (id == null) return null if (id == null) return null
return getKey("$currentAccount/$RESULT_WATCH_STATE_DATA", id.toString()) return getKey<BookmarkedData>("$currentAccount/$RESULT_WATCH_STATE_DATA", id.toString())
} }
fun getAllBookmarkedData(): List<BookmarkedData> { fun getAllBookmarkedData(): List<BookmarkedData> {
return getKeys("$currentAccount/$RESULT_WATCH_STATE_DATA")?.mapNotNull { return getKeys("$currentAccount/$RESULT_WATCH_STATE_DATA")?.mapNotNull {
getKey(it) getKey<BookmarkedData>(it)
} ?: emptyList() } ?: emptyList()
} }
fun getAllSubscriptions(): List<SubscribedData> { fun getAllSubscriptions(): List<SubscribedData> {
return getKeys("$currentAccount/$RESULT_SUBSCRIBED_STATE_DATA")?.mapNotNull { return getKeys("$currentAccount/$RESULT_SUBSCRIBED_STATE_DATA")?.mapNotNull {
getKey(it) getKey<SubscribedData>(it)
} ?: emptyList() } ?: emptyList()
} }
@ -598,12 +644,12 @@ object DataStoreHelper {
/** /**
* Set new seen episodes and update time * Set new seen episodes and update time
**/ */
fun updateSubscribedData(id: Int?, data: SubscribedData?, episodeResponse: EpisodeResponse?) { fun updateSubscribedData(id: Int?, data: SubscribedData?, episodeResponse: EpisodeResponse?) {
if (id == null || data == null || episodeResponse == null) return if (id == null || data == null || episodeResponse == null) return
val newData = data.copy( val newData = data.copy(
latestUpdatedTime = unixTimeMS, latestUpdatedTime = unixTimeMS,
lastSeenEpisodeCount = episodeResponse.getLatestEpisodes() lastSeenEpisodeCount = episodeResponse.getLatestEpisodes(),
) )
setKey("$currentAccount/$RESULT_SUBSCRIBED_STATE_DATA", id.toString(), newData) setKey("$currentAccount/$RESULT_SUBSCRIBED_STATE_DATA", id.toString(), newData)
} }
@ -616,12 +662,12 @@ object DataStoreHelper {
fun getSubscribedData(id: Int?): SubscribedData? { fun getSubscribedData(id: Int?): SubscribedData? {
if (id == null) return null if (id == null) return null
return getKey("$currentAccount/$RESULT_SUBSCRIBED_STATE_DATA", id.toString()) return getKey<SubscribedData>("$currentAccount/$RESULT_SUBSCRIBED_STATE_DATA", id.toString())
} }
fun getAllFavorites(): List<FavoritesData> { fun getAllFavorites(): List<FavoritesData> {
return getKeys("$currentAccount/$RESULT_FAVORITES_STATE_DATA")?.mapNotNull { return getKeys("$currentAccount/$RESULT_FAVORITES_STATE_DATA")?.mapNotNull {
getKey(it) getKey<FavoritesData>(it)
} ?: emptyList() } ?: emptyList()
} }
@ -639,7 +685,7 @@ object DataStoreHelper {
fun getFavoritesData(id: Int?): FavoritesData? { fun getFavoritesData(id: Int?): FavoritesData? {
if (id == null) return null if (id == null) return null
return getKey("$currentAccount/$RESULT_FAVORITES_STATE_DATA", id.toString()) return getKey<FavoritesData>("$currentAccount/$RESULT_FAVORITES_STATE_DATA", id.toString())
} }
fun setViewPos(id: Int?, pos: Long, dur: Long) { fun setViewPos(id: Int?, pos: Long, dur: Long) {
@ -648,10 +694,10 @@ object DataStoreHelper {
setKey("$currentAccount/$VIDEO_POS_DUR", id.toString(), PosDur(pos, dur)) setKey("$currentAccount/$VIDEO_POS_DUR", id.toString(), PosDur(pos, dur))
} }
/** Sets the position, duration, and resume data of an episode/movie, /**
* * Sets the position, duration, and resume data of an episode/movie,
* if nextEpisode is not specified it will not be able to set the next episode as resumable if progress > NEXT_WATCH_EPISODE_PERCENTAGE * If nextEpisode is not specified it will not be able to set the next episode as resumable if progress > NEXT_WATCH_EPISODE_PERCENTAGE
* */ */
fun setViewPosAndResume(id: Int?, position: Long, duration: Long, currentEpisode: Any?, nextEpisode: Any?) { fun setViewPosAndResume(id: Int?, position: Long, duration: Long, currentEpisode: Any?, nextEpisode: Any?) {
setViewPos(id, position, duration) setViewPos(id, position, duration)
if (id != null) { if (id != null) {
@ -687,7 +733,7 @@ object DataStoreHelper {
resumeMeta.id, resumeMeta.id,
resumeMeta.episode, resumeMeta.episode,
resumeMeta.season, resumeMeta.season,
isFromDownload = false isFromDownload = false,
) )
} }
@ -697,7 +743,7 @@ object DataStoreHelper {
resumeMeta.id, resumeMeta.id,
resumeMeta.episode, resumeMeta.episode,
resumeMeta.season, resumeMeta.season,
isFromDownload = true isFromDownload = true,
) )
} }
} }
@ -706,17 +752,16 @@ object DataStoreHelper {
fun getViewPos(id: Int?): PosDur? { fun getViewPos(id: Int?): PosDur? {
if (id == null) return null if (id == null) return null
return getKey("$currentAccount/$VIDEO_POS_DUR", id.toString(), null) return getKey<PosDur>("$currentAccount/$VIDEO_POS_DUR", id.toString(), null)
} }
fun getVideoWatchState(id: Int?): VideoWatchState? { fun getVideoWatchState(id: Int?): VideoWatchState? {
if (id == null) return null if (id == null) return null
return getKey("$currentAccount/$VIDEO_WATCH_STATE", id.toString(), null) return getKey<VideoWatchState>("$currentAccount/$VIDEO_WATCH_STATE", id.toString(), null)
} }
fun setVideoWatchState(id: Int?, watchState: VideoWatchState) { fun setVideoWatchState(id: Int?, watchState: VideoWatchState) {
if (id == null) return if (id == null) return
// None == No key // None == No key
if (watchState == VideoWatchState.None) { if (watchState == VideoWatchState.None) {
removeKey("$currentAccount/$VIDEO_WATCH_STATE", id.toString()) removeKey("$currentAccount/$VIDEO_WATCH_STATE", id.toString())
@ -727,7 +772,7 @@ object DataStoreHelper {
fun getDub(id: Int): DubStatus? { fun getDub(id: Int): DubStatus? {
return DubStatus.entries return DubStatus.entries
.getOrNull(getKey("$currentAccount/$RESULT_DUB", id.toString(), -1) ?: -1) .getOrNull(getKey<Int>("$currentAccount/$RESULT_DUB", id.toString(), -1) ?: -1)
} }
fun setDub(id: Int, status: DubStatus) { fun setDub(id: Int, status: DubStatus) {
@ -748,13 +793,13 @@ object DataStoreHelper {
getKey<Int>( getKey<Int>(
"$currentAccount/$RESULT_WATCH_STATE", "$currentAccount/$RESULT_WATCH_STATE",
id.toString(), id.toString(),
null null,
) )
) )
} }
fun getResultSeason(id: Int): Int? { fun getResultSeason(id: Int): Int? {
return getKey("$currentAccount/$RESULT_SEASON", id.toString(), null) return getKey<Int>("$currentAccount/$RESULT_SEASON", id.toString(), null)
} }
fun setResultSeason(id: Int, value: Int?) { fun setResultSeason(id: Int, value: Int?) {
@ -762,7 +807,7 @@ object DataStoreHelper {
} }
fun getResultEpisode(id: Int): Int? { fun getResultEpisode(id: Int): Int? {
return getKey("$currentAccount/$RESULT_EPISODE", id.toString(), null) return getKey<Int>("$currentAccount/$RESULT_EPISODE", id.toString(), null)
} }
fun setResultEpisode(id: Int, value: Int?) { fun setResultEpisode(id: Int, value: Int?) {
@ -775,12 +820,11 @@ object DataStoreHelper {
fun getSync(id: Int, idPrefixes: List<String>): List<String?> { fun getSync(id: Int, idPrefixes: List<String>): List<String?> {
return idPrefixes.map { idPrefix -> return idPrefixes.map { idPrefix ->
getKey("${idPrefix}_sync", id.toString()) getKey<String>("${idPrefix}_sync", id.toString())
} }
} }
var pinnedProviders: Array<String> var pinnedProviders: Array<String>
get() = getKey(USER_PINNED_PROVIDERS) ?: emptyArray<String>() get() = getKey<Array<String>>(USER_PINNED_PROVIDERS) ?: emptyArray<String>()
set(value) = setKey(USER_PINNED_PROVIDERS, value) set(value) = setKey(USER_PINNED_PROVIDERS, value)
} }

View file

@ -72,7 +72,7 @@ object SyncUtil {
// Gogoanime, Twistmoe and 9anime // Gogoanime, Twistmoe and 9anime
val url = "https://raw.githubusercontent.com/MALSync/MAL-Sync-Backup/master/data/pages/$site/$slug.json" val url = "https://raw.githubusercontent.com/MALSync/MAL-Sync-Backup/master/data/pages/$site/$slug.json"
val response = app.get(url, cacheTime = 1, cacheUnit = TimeUnit.DAYS).text val response = app.get(url, cacheTime = 1, cacheUnit = TimeUnit.DAYS).text
val mapped = tryParseJson<MalSyncPage?>(response) val mapped = tryParseJson<MalSyncPage>(response)
val overrideMal = mapped?.malId ?: mapped?.mal?.id ?: mapped?.anilist?.malId val overrideMal = mapped?.malId ?: mapped?.mal?.id ?: mapped?.anilist?.malId
val overrideAnilist = mapped?.aniId ?: mapped?.anilist?.id val overrideAnilist = mapped?.aniId ?: mapped?.anilist?.id

View file

@ -200,7 +200,7 @@ object TestingUtils {
} }
else -> { else -> {
logger.error("Unknown load response: ${loadResponse.javaClass.name}") logger.error("Unknown load response: ${loadResponse::class.qualifiedName}")
return TestResult.Fail return TestResult.Fail
} }
} ?: return TestResult.Fail } ?: return TestResult.Fail

View file

@ -23,15 +23,15 @@ const val PROGRAM_ID_LIST_KEY = "persistent_program_ids"
object TvChannelUtils { object TvChannelUtils {
fun Context.saveProgramId(programId: Long) { fun Context.saveProgramId(programId: Long) {
val existing: List<Long> = getKey(PROGRAM_ID_LIST_KEY) ?: emptyList() val existing: List<Long> = getKey<List<Long>>(PROGRAM_ID_LIST_KEY) ?: emptyList()
val updated = (existing + programId).distinct() val updated = (existing + programId).distinct()
setKey(PROGRAM_ID_LIST_KEY, updated) setKey(PROGRAM_ID_LIST_KEY, updated)
} }
fun Context.getStoredProgramIds(): List<Long> { fun Context.getStoredProgramIds(): List<Long> {
return getKey(PROGRAM_ID_LIST_KEY) ?: emptyList() return getKey<List<Long>>(PROGRAM_ID_LIST_KEY) ?: emptyList()
} }
fun Context.removeProgramId(programId: Long) { fun Context.removeProgramId(programId: Long) {
val existing: List<Long> = getKey(PROGRAM_ID_LIST_KEY) ?: emptyList() val existing: List<Long> = getKey<List<Long>>(PROGRAM_ID_LIST_KEY) ?: emptyList()
val updated = existing.filter { it != programId } val updated = existing.filter { it != programId }
setKey(PROGRAM_ID_LIST_KEY, updated) setKey(PROGRAM_ID_LIST_KEY, updated)
} }
@ -149,10 +149,12 @@ object TvChannelUtils {
.setInputId(inputId) .setInputId(inputId)
.build() .build()
val channelUri = context.contentResolver.insert( val channelUri = runCatching {
context.contentResolver.insert(
TvContractCompat.Channels.CONTENT_URI, TvContractCompat.Channels.CONTENT_URI,
channel.toContentValues() channel.toContentValues()
) )
}.getOrNull()
channelUri?.let { channelUri?.let {
val channelId = ContentUris.parseId(it) val channelId = ContentUris.parseId(it)

View file

@ -65,9 +65,12 @@ import androidx.navigation.fragment.NavHostFragment
import androidx.palette.graphics.Palette import androidx.palette.graphics.Palette
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import com.google.android.material.appbar.AppBarLayout import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.button.MaterialButton
import com.google.android.material.chip.Chip import com.google.android.material.chip.Chip
import com.google.android.material.chip.ChipDrawable import com.google.android.material.chip.ChipDrawable
import com.google.android.material.chip.ChipGroup import com.google.android.material.chip.ChipGroup
import com.google.android.material.progressindicator.CircularProgressIndicatorSpec
import com.google.android.material.progressindicator.IndeterminateDrawable
import com.lagradost.cloudstream3.CloudStreamApp.Companion.context import com.lagradost.cloudstream3.CloudStreamApp.Companion.context
import com.lagradost.cloudstream3.CommonActivity.activity import com.lagradost.cloudstream3.CommonActivity.activity
import com.lagradost.cloudstream3.CommonActivity.showToast import com.lagradost.cloudstream3.CommonActivity.showToast
@ -583,6 +586,43 @@ object UIHelper {
} }
} }
/**
* Source: https://stackoverflow.com/questions/70954321/circular-progress-indicator-inside-buttons-android-material-design
*
* Shows indeterminate progress bar on this button in place of where icon would be.
* By default the tint of progress bar is the same as iconTint.
*
* @param tintColor (@ColorInt Int) Sets custom progress bar tint color.
*/
fun MaterialButton.showProgress(@ColorInt tintColor: Int = this.iconTint.defaultColor) =
// Use runOnMainThreadNative to allow process on io threads, to make the code a bit cleaner
runOnMainThreadNative {
// No need to set it again, as then it will reset the animation
if(this.icon is IndeterminateDrawable<*>) {
return@runOnMainThreadNative
}
val spec = CircularProgressIndicatorSpec(
context, null, 0,
com.google.android.material.R.style.Widget_Material3_CircularProgressIndicator_ExtraSmall
)
spec.indicatorColors = intArrayOf(tintColor)
val progressIndicatorDrawable =
IndeterminateDrawable.createCircularDrawable(context, spec)
this.icon = progressIndicatorDrawable
if (this.getTag(R.id.text1) == null)
this.setTag(R.id.text1, this.text)
this.text = ""
}
fun MaterialButton.hideProgress() =
runOnMainThreadNative {
this.text = this.getTag(R.id.text1) as? String
this.icon = null
}
/**id, stringRes */ /**id, stringRes */
@SuppressLint("RestrictedApi") @SuppressLint("RestrictedApi")
fun View.popupMenuNoIcons( fun View.popupMenuNoIcons(

View file

@ -1640,11 +1640,11 @@ object VideoDownloadManager {
} }
fun getDownloadResumePackage(context: Context, id: Int): DownloadResumePackage? { fun getDownloadResumePackage(context: Context, id: Int): DownloadResumePackage? {
return context.getKey(KEY_RESUME_PACKAGES, id.toString()) return context.getKey<DownloadResumePackage>(KEY_RESUME_PACKAGES, id.toString())
} }
fun getDownloadQueuePackage(context: Context, id: Int): DownloadQueueWrapper? { fun getDownloadQueuePackage(context: Context, id: Int): DownloadQueueWrapper? {
return context.getKey(KEY_RESUME_IN_QUEUE, id.toString()) return context.getKey<DownloadQueueWrapper>(KEY_RESUME_IN_QUEUE, id.toString())
} }
fun getDownloadEpisodeMetadata( fun getDownloadEpisodeMetadata(

View file

@ -1,23 +1,32 @@
package com.lagradost.cloudstream3.utils.downloader package com.lagradost.cloudstream3.utils.downloader
import android.net.Uri import android.net.Uri
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.Score import com.lagradost.cloudstream3.Score
import com.lagradost.cloudstream3.SkipSerializationTest
import com.lagradost.cloudstream3.TvType import com.lagradost.cloudstream3.TvType
import com.lagradost.cloudstream3.services.DownloadQueueService import com.lagradost.cloudstream3.services.DownloadQueueService
import com.lagradost.cloudstream3.ui.player.SubtitleData import com.lagradost.cloudstream3.ui.player.SubtitleData
import com.lagradost.cloudstream3.ui.result.ResultEpisode import com.lagradost.cloudstream3.ui.result.ResultEpisode
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.serializers.UriSerializer
import com.lagradost.cloudstream3.utils.serializers.WriteOnlySerializer
import com.lagradost.safefile.SafeFile import com.lagradost.safefile.SafeFile
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.KeepGeneratedSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.io.IOException import java.io.IOException
import java.io.OutputStream import java.io.OutputStream
import java.util.Objects import java.util.Objects
object DownloadObjects { object DownloadObjects {
/** An item can either be something to resume or something new to start */ /** An item can either be something to resume or something new to start */
@Serializable
data class DownloadQueueWrapper( data class DownloadQueueWrapper(
@JsonProperty("resumePackage") val resumePackage: DownloadResumePackage?, @JsonProperty("resumePackage") @SerialName("resumePackage") val resumePackage: DownloadResumePackage?,
@JsonProperty("downloadItem") val downloadItem: DownloadQueueItem?, @JsonProperty("downloadItem") @SerialName("downloadItem") val downloadItem: DownloadQueueItem?,
) { ) {
init { init {
assert(resumePackage != null || downloadItem != null) { assert(resumePackage != null || downloadItem != null) {
@ -26,56 +35,66 @@ object DownloadObjects {
} }
/** Loop through the current download instances to see if it is currently downloading. Also includes link loading. */ /** Loop through the current download instances to see if it is currently downloading. Also includes link loading. */
@JsonIgnore
fun isCurrentlyDownloading(): Boolean { fun isCurrentlyDownloading(): Boolean {
return DownloadQueueService.downloadInstances.value.any { it.downloadQueueWrapper.id == this.id } return DownloadQueueService.downloadInstances.value.any { it.downloadQueueWrapper.id == this.id }
} }
@JsonProperty("id") @JsonProperty("id") @SerialName("id")
val id = resumePackage?.item?.ep?.id ?: downloadItem!!.episode.id val id = resumePackage?.item?.ep?.id ?: downloadItem!!.episode.id
@JsonProperty("parentId") @JsonProperty("parentId") @SerialName("parentId")
val parentId = resumePackage?.item?.ep?.parentId ?: downloadItem!!.episode.parentId val parentId = resumePackage?.item?.ep?.parentId ?: downloadItem!!.episode.parentId
} }
/** General data about the episode and show to start a download from. */ /** General data about the episode and show to start a download from. */
@Serializable
data class DownloadQueueItem( data class DownloadQueueItem(
@JsonProperty("episode") val episode: ResultEpisode, @JsonProperty("episode") @SerialName("episode") val episode: ResultEpisode,
@JsonProperty("isMovie") val isMovie: Boolean, @JsonProperty("isMovie") @SerialName("isMovie") val isMovie: Boolean,
@JsonProperty("resultName") val resultName: String, @JsonProperty("resultName") @SerialName("resultName") val resultName: String,
@JsonProperty("resultType") val resultType: TvType, @JsonProperty("resultType") @SerialName("resultType") val resultType: TvType,
@JsonProperty("resultPoster") val resultPoster: String?, @JsonProperty("resultPoster") @SerialName("resultPoster") val resultPoster: String?,
@JsonProperty("apiName") val apiName: String, @JsonProperty("apiName") @SerialName("apiName") val apiName: String,
@JsonProperty("resultId") val resultId: Int, @JsonProperty("resultId") @SerialName("resultId") val resultId: Int,
@JsonProperty("resultUrl") val resultUrl: String, @JsonProperty("resultUrl") @SerialName("resultUrl") val resultUrl: String,
@JsonProperty("links") val links: List<ExtractorLink>? = null, @JsonProperty("links") @SerialName("links") val links: List<ExtractorLink>? = null,
@JsonProperty("subs") val subs: List<SubtitleData>? = null, @JsonProperty("subs") @SerialName("subs") val subs: List<SubtitleData>? = null,
) { ) {
fun toWrapper(): DownloadQueueWrapper { fun toWrapper(): DownloadQueueWrapper {
return DownloadQueueWrapper(null, this) return DownloadQueueWrapper(null, this)
} }
} }
interface DownloadCached {
val id: Int
}
abstract class DownloadCached( @OptIn(ExperimentalSerializationApi::class) // KeepGeneratedSerializer is an experimental annotation for now
@JsonProperty("id") open val id: Int, @KeepGeneratedSerializer
@Serializable(with = DownloadEpisodeCached.Serializer::class)
data class DownloadEpisodeCached(
@JsonProperty("name") @SerialName("name") val name: String?,
@JsonProperty("poster") @SerialName("poster") val poster: String?,
@JsonProperty("episode") @SerialName("episode") val episode: Int,
@JsonProperty("season") @SerialName("season") val season: Int?,
@JsonProperty("parentId") @SerialName("parentId") val parentId: Int,
@JsonProperty("score") @SerialName("score") var score: Score? = null,
@JsonProperty("description") @SerialName("description") val description: String?,
@JsonProperty("cacheTime") @SerialName("cacheTime") val cacheTime: Long,
@JsonProperty("id") @SerialName("id") override val id: Int,
) : DownloadCached {
object Serializer : WriteOnlySerializer<DownloadEpisodeCached>(
DownloadEpisodeCached.generatedSerializer(),
setOf("rating"),
) )
data class DownloadEpisodeCached(
@JsonProperty("name") val name: String?,
@JsonProperty("poster") val poster: String?,
@JsonProperty("episode") val episode: Int,
@JsonProperty("season") val season: Int?,
@JsonProperty("parentId") val parentId: Int,
@JsonProperty("score") var score: Score? = null,
@JsonProperty("description") val description: String?,
@JsonProperty("cacheTime") val cacheTime: Long,
override val id: Int,
) : DownloadCached(id) {
@JsonProperty("rating", access = JsonProperty.Access.WRITE_ONLY) @JsonProperty("rating", access = JsonProperty.Access.WRITE_ONLY)
@SerialName("rating")
@Deprecated( @Deprecated(
"`rating` is the old scoring system, use score instead", "`rating` is the old scoring system, use score instead",
replaceWith = ReplaceWith("score"), replaceWith = ReplaceWith("score"),
level = DeprecationLevel.ERROR level = DeprecationLevel.ERROR,
) )
var rating: Int? = null var rating: Int? = null
set(value) { set(value) {
@ -87,74 +106,81 @@ object DownloadObjects {
} }
/** What to display to the user for a downloaded show/movie. Includes info such as name, poster and url */ /** What to display to the user for a downloaded show/movie. Includes info such as name, poster and url */
@Serializable
data class DownloadHeaderCached( data class DownloadHeaderCached(
@JsonProperty("apiName") val apiName: String, @JsonProperty("apiName") @SerialName("apiName") val apiName: String,
@JsonProperty("url") val url: String, @JsonProperty("url") @SerialName("url") val url: String,
@JsonProperty("type") val type: TvType, @JsonProperty("type") @SerialName("type") val type: TvType,
@JsonProperty("name") val name: String, @JsonProperty("name") @SerialName("name") val name: String,
@JsonProperty("poster") val poster: String?, @JsonProperty("poster") @SerialName("poster") val poster: String?,
@JsonProperty("cacheTime") val cacheTime: Long, @JsonProperty("cacheTime") @SerialName("cacheTime") val cacheTime: Long,
override val id: Int, @JsonProperty("id") @SerialName("id") override val id: Int,
) : DownloadCached(id) ) : DownloadCached
@Serializable
data class DownloadResumePackage( data class DownloadResumePackage(
@JsonProperty("item") val item: DownloadItem, @JsonProperty("item") @SerialName("item") val item: DownloadItem,
/** Tills which link should get resumed */ /** Tills which link should get resumed */
@JsonProperty("linkIndex") val linkIndex: Int?, @JsonProperty("linkIndex") @SerialName("linkIndex") val linkIndex: Int?,
) { ) {
fun toWrapper(): DownloadQueueWrapper { fun toWrapper(): DownloadQueueWrapper {
return DownloadQueueWrapper(this, null) return DownloadQueueWrapper(this, null)
} }
} }
@Serializable
data class DownloadItem( data class DownloadItem(
@JsonProperty("source") val source: String?, @JsonProperty("source") @SerialName("source") val source: String?,
@JsonProperty("folder") val folder: String?, @JsonProperty("folder") @SerialName("folder") val folder: String?,
@JsonProperty("ep") val ep: DownloadEpisodeMetadata, @JsonProperty("ep") @SerialName("ep") val ep: DownloadEpisodeMetadata,
@JsonProperty("links") val links: List<ExtractorLink>, @JsonProperty("links") @SerialName("links") val links: List<ExtractorLink>,
) )
/** Metadata for a specific episode and how to display it. */ /** Metadata for a specific episode and how to display it. */
@Serializable
data class DownloadEpisodeMetadata( data class DownloadEpisodeMetadata(
@JsonProperty("id") val id: Int, @JsonProperty("id") @SerialName("id") val id: Int,
@JsonProperty("parentId") val parentId: Int, @JsonProperty("parentId") @SerialName("parentId") val parentId: Int,
@JsonProperty("mainName") val mainName: String, @JsonProperty("mainName") @SerialName("mainName") val mainName: String,
@JsonProperty("sourceApiName") val sourceApiName: String?, @JsonProperty("sourceApiName") @SerialName("sourceApiName") val sourceApiName: String?,
@JsonProperty("poster") val poster: String?, @JsonProperty("poster") @SerialName("poster") val poster: String?,
@JsonProperty("name") val name: String?, @JsonProperty("name") @SerialName("name") val name: String?,
@JsonProperty("season") val season: Int?, @JsonProperty("season") @SerialName("season") val season: Int?,
@JsonProperty("episode") val episode: Int?, @JsonProperty("episode") @SerialName("episode") val episode: Int?,
@JsonProperty("type") val type: TvType?, @JsonProperty("type") @SerialName("type") val type: TvType?,
) )
@Serializable
data class DownloadedFileInfo( data class DownloadedFileInfo(
@JsonProperty("totalBytes") val totalBytes: Long, @JsonProperty("totalBytes") @SerialName("totalBytes") val totalBytes: Long,
@JsonProperty("relativePath") val relativePath: String, @JsonProperty("relativePath") @SerialName("relativePath") val relativePath: String,
@JsonProperty("displayName") val displayName: String, @JsonProperty("displayName") @SerialName("displayName") val displayName: String,
@JsonProperty("extraInfo") val extraInfo: String? = null, @JsonProperty("extraInfo") @SerialName("extraInfo") val extraInfo: String? = null,
@JsonProperty("basePath") val basePath: String? = null, // null is for legacy downloads. See getBasePath() @JsonProperty("basePath") @SerialName("basePath") val basePath: String? = null, // null is for legacy downloads. See getBasePath()
// Hash of the link associated with this DownloadFile, used so not override old data in the DownloadedFileInfo // Hash of the link associated with this DownloadFile, used so not override old data in the DownloadedFileInfo
@JsonProperty("linkHash") val linkHash : Int? = null @JsonProperty("linkHash") @SerialName("linkHash") val linkHash: Int? = null,
) )
@Serializable
@SkipSerializationTest // Uri has issues with Jackson
data class DownloadedFileInfoResult( data class DownloadedFileInfoResult(
@JsonProperty("fileLength") val fileLength: Long, @JsonProperty("fileLength") @SerialName("fileLength") val fileLength: Long,
@JsonProperty("totalBytes") val totalBytes: Long, @JsonProperty("totalBytes") @SerialName("totalBytes") val totalBytes: Long,
@JsonProperty("path") val path: Uri, @JsonProperty("path") @SerialName("path")
@Serializable(with = UriSerializer::class)
val path: Uri,
) )
@Serializable
data class ResumeWatching( data class ResumeWatching(
@JsonProperty("parentId") val parentId: Int, @JsonProperty("parentId") @SerialName("parentId") val parentId: Int,
@JsonProperty("episodeId") val episodeId: Int?, @JsonProperty("episodeId") @SerialName("episodeId") val episodeId: Int?,
@JsonProperty("episode") val episode: Int?, @JsonProperty("episode") @SerialName("episode") val episode: Int?,
@JsonProperty("season") val season: Int?, @JsonProperty("season") @SerialName("season") val season: Int?,
@JsonProperty("updateTime") val updateTime: Long, @JsonProperty("updateTime") @SerialName("updateTime") val updateTime: Long,
@JsonProperty("isFromDownload") val isFromDownload: Boolean, @JsonProperty("isFromDownload") @SerialName("isFromDownload") val isFromDownload: Boolean,
) )
data class DownloadStatus( data class DownloadStatus(
/** if you should retry with the same args and hope for a better result */ /** if you should retry with the same args and hope for a better result */
val retrySame: Boolean, val retrySame: Boolean,
@ -164,14 +190,13 @@ object DownloadObjects {
val success: Boolean, val success: Boolean,
) )
data class CreateNotificationMetadata( data class CreateNotificationMetadata(
val type: VideoDownloadManager.DownloadType, val type: VideoDownloadManager.DownloadType,
val bytesDownloaded: Long, val bytesDownloaded: Long,
val bytesTotal: Long, val bytesTotal: Long,
val hlsProgress: Long? = null, val hlsProgress: Long? = null,
val hlsTotal: Long? = null, val hlsTotal: Long? = null,
val bytesPerSecond: Long val bytesPerSecond: Long,
) )
data class StreamData( data class StreamData(
@ -198,9 +223,11 @@ object DownloadObjects {
val exists: Boolean get() = file.exists() == true val exists: Boolean get() = file.exists() == true
} }
/**
/** bytes have the size end-start where the byte range is [start,end) * Bytes have the size end-start where the byte range is [start,end)
* note that ByteArray is a pointer and therefore cant be stored without cloning it */ * note that ByteArray is a pointer and therefore can't be stored
* without cloning it.
*/
data class LazyStreamDownloadResponse( data class LazyStreamDownloadResponse(
val bytes: ByteArray, val bytes: ByteArray,
val startByte: Long, val startByte: Long,

View file

@ -1,6 +1,7 @@
package com.lagradost.cloudstream3.utils.serializers package com.lagradost.cloudstream3.utils.serializers
import android.net.Uri import android.net.Uri
import com.lagradost.cloudstream3.InternalAPI
import kotlinx.serialization.KSerializer import kotlinx.serialization.KSerializer
import kotlinx.serialization.descriptors.PrimitiveKind import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
@ -26,6 +27,7 @@ import kotlinx.serialization.encoding.Encoder
* val uri: Uri, * val uri: Uri,
* ) * )
*/ */
@InternalAPI
object UriSerializer : KSerializer<Uri> { object UriSerializer : KSerializer<Uri> {
override val descriptor: SerialDescriptor = override val descriptor: SerialDescriptor =
PrimitiveSerialDescriptor("Uri", PrimitiveKind.STRING) PrimitiveSerialDescriptor("Uri", PrimitiveKind.STRING)

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="m612,668 l56,-56 -148,-148v-184h-80v216l172,172ZM480,880q-83,0 -156,-31.5T197,763q-54,-54 -85.5,-127T80,480q0,-83 31.5,-156T197,197q54,-54 127,-85.5T480,80q83,0 156,31.5T763,197q54,54 85.5,127T880,480q0,83 -31.5,156T763,763q-54,54 -127,85.5T480,880ZM480,480ZM480,800q133,0 226.5,-93.5T800,480q0,-133 -93.5,-226.5T480,160q-133,0 -226.5,93.5T160,480q0,133 93.5,226.5T480,800Z"
android:fillColor="#e3e3e3"/>
</vector>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -19,8 +18,8 @@
android:id="@+id/subtitles_click_settings" android:id="@+id/subtitles_click_settings"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"> android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
@ -33,14 +32,21 @@
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" /> android:textStyle="bold" />
<com.google.android.material.button.MaterialButton
android:id="@+id/settings_btt"
style="@style/WhiteButton"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical|end"
android:text="@string/title_settings" />
<ImageView <ImageView
android:id="@+id/help_btt" android:id="@+id/help_btt"
android:layout_width="44dp" android:layout_width="44dp"
android:layout_height="44dp" android:layout_height="44dp"
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/help"
android:padding="10dp" android:padding="10dp"
android:src="@drawable/baseline_help_outline_24" android:src="@drawable/baseline_help_outline_24" />
android:contentDescription="@string/help" />
</LinearLayout> </LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
@ -93,8 +99,8 @@
android:id="@+id/apply_btt_holder" android:id="@+id/apply_btt_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="60dp"
android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="?android:attr/listPreferredItemPaddingStart"> android:paddingHorizontal="?android:attr/listPreferredItemPaddingStart">
<EditText <EditText
@ -108,19 +114,19 @@
android:textColor="?attr/textColor" android:textColor="?attr/textColor"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" android:textStyle="bold"
tools:text="@string/profile_number" tools:ignore="LabelFor"
tools:ignore="LabelFor" /> tools:text="@string/profile_number" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/save_btt" android:id="@+id/save_btt"
style="@style/WhiteButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:text="@string/sort_save" android:text="@string/sort_save" />
style="@style/WhiteButton" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/close_btt" android:id="@+id/close_btt"
style="@style/BlackButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:text="@string/sort_close" android:text="@string/sort_close" />
style="@style/BlackButton" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -47,6 +47,7 @@
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/voice_actor_image_holder2"
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="70dp" android:layout_height="70dp"
android:foreground="@drawable/outline_drawable" android:foreground="@drawable/outline_drawable"

View file

@ -261,7 +261,7 @@
android:padding="8dp" android:padding="8dp"
android:src="@drawable/ic_network_stream" android:src="@drawable/ic_network_stream"
app:tint="?attr/textColor"></ImageView> app:tint="?attr/textColor" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
@ -306,7 +306,7 @@
android:paddingBottom="100dp" android:paddingBottom="100dp"
android:clipToPadding="false" android:clipToPadding="false"
android:descendantFocusability="afterDescendants" android:descendantFocusability="afterDescendants"
android:nextFocusUp="@id/download_appbar" android:nextFocusUp="@id/download_stream_button_tv"
android:nextFocusLeft="@id/navigation_downloads" android:nextFocusLeft="@id/navigation_downloads"
android:nextFocusDown="@id/download_queue_button" android:nextFocusDown="@id/download_queue_button"
android:tag="@string/tv_no_focus_tag" android:tag="@string/tv_no_focus_tag"

View file

@ -53,7 +53,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/primaryBlackBackground" android:background="?attr/primaryBlackBackground"
android:clipToPadding="false" android:clipToPadding="false"
android:layout_marginBottom="80dp"
android:nextFocusLeft="@id/nav_rail_view" android:nextFocusLeft="@id/nav_rail_view"
android:nextFocusUp="@id/tvtypes_chips" android:nextFocusUp="@id/tvtypes_chips"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
@ -241,6 +241,8 @@
android:focusable="true" android:focusable="true"
android:nextFocusLeft="@id/plugin_storage_appbar" android:nextFocusLeft="@id/plugin_storage_appbar"
android:nextFocusUp="@id/repo_recycler_view" android:nextFocusUp="@id/repo_recycler_view"
android:nextFocusRight="@id/add_repo_button_imageview"
android:nextFocusDown="@id/add_repo_button_imageview"
android:src="@drawable/ic_baseline_add_24" android:src="@drawable/ic_baseline_add_24"
app:tint="?attr/textColor" /> app:tint="?attr/textColor" />

View file

@ -227,6 +227,12 @@
tools:listitem="@layout/homepage_parent" tools:listitem="@layout/homepage_parent"
tools:visibility="gone" /> tools:visibility="gone" />
<TextClock
android:id="@+id/home_clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/home_api_fab" android:id="@+id/home_api_fab"
style="@style/ExtendedFloatingActionButton" style="@style/ExtendedFloatingActionButton"

View file

@ -93,6 +93,7 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</com.facebook.shimmer.ShimmerFrameLayout> </com.facebook.shimmer.ShimmerFrameLayout>
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
@ -163,6 +164,22 @@
tools:listitem="@layout/homepage_parent_tv" tools:listitem="@layout/homepage_parent_tv"
tools:visibility="gone" /> tools:visibility="gone" />
<TextClock
android:id="@+id/home_clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="600dp"
android:textColor="@color/white"
android:textSize="20sp"
android:visibility="visible"
android:format12Hour="hh:mm a"
android:format24Hour="HH:mm"
android:fontFamily="@font/google_sans"
android:textStyle="bold"
android:gravity="start"
android:layout_gravity="start"
android:layout_margin="10dp" />
<LinearLayout <LinearLayout
android:id="@+id/home_api_holder" android:id="@+id/home_api_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -264,6 +264,15 @@
tools:visibility="visible" tools:visibility="visible"
android:layout_gravity="center"/> android:layout_gravity="center"/>
</LinearLayout> </LinearLayout>
<TextClock
android:id="@+id/player_video_clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:gravity="end"
android:visibility="gone"
android:textStyle="bold" />
</LinearLayout> </LinearLayout>
<!-- Removed as it has no use anymore--> <!-- Removed as it has no use anymore-->
@ -1076,6 +1085,8 @@
<FrameLayout <FrameLayout
android:id="@+id/subtitle_holder" android:id="@+id/subtitle_holder"
android:clipChildren="false"
android:clipToPadding="false"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">

View file

@ -352,6 +352,22 @@
android:layout_marginEnd="32dp" android:layout_marginEnd="32dp"
android:orientation="vertical"> android:orientation="vertical">
<TextClock
android:id="@+id/player_video_clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:gravity="end"
android:maxWidth="600dp"
android:textAlignment="viewEnd"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="visible"
android:format12Hour="hh:mm a"
android:format24Hour="HH:mm"
android:fontFamily="@font/google_sans"
android:textStyle="bold" />
<LinearLayout <LinearLayout
android:id="@+id/player_video_title_holder" android:id="@+id/player_video_title_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -1116,6 +1132,8 @@
<FrameLayout <FrameLayout
android:id="@+id/subtitle_holder" android:id="@+id/subtitle_holder"
android:clipChildren="false"
android:clipToPadding="false"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">

View file

@ -160,6 +160,13 @@
<!-- android:layout_gravity="center"--> <!-- android:layout_gravity="center"-->
<!-- android:src="@drawable/outline_edit_24" />--> <!-- android:src="@drawable/outline_edit_24" />-->
<com.google.android.material.button.MaterialButton
android:id="@+id/settings_btt"
style="@style/WhiteButton"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical|end"
android:text="@string/title_settings" />
<Space <Space
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -80,8 +80,8 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:textColor="?attr/grayTextColor" android:textColor="?attr/grayTextColor"
tools:text="Votes: 10K"
android:visibility="gone" android:visibility="gone"
tools:text="Votes: 10K"
tools:visibility="visible" /> tools:visibility="visible" />
<TextView <TextView
@ -103,6 +103,14 @@
android:textColor="?attr/grayTextColor" android:textColor="?attr/grayTextColor"
android:textSize="12sp" android:textSize="12sp"
tools:text="https://github.com/..." /> tools:text="https://github.com/..." />
<com.google.android.material.button.MaterialButton
android:layout_marginTop="5dp"
tools:visibility="visible"
android:visibility="gone"
android:id="@+id/repository_name_text"
style="@style/SmallBlackButton"
tools:text="Repository name" />
</LinearLayout> </LinearLayout>
<ImageView <ImageView

View file

@ -106,6 +106,13 @@
android:textSize="12sp" android:textSize="12sp"
tools:text="https://github.com/..." /> tools:text="https://github.com/..." />
<com.google.android.material.button.MaterialButton
android:layout_marginTop="5dp"
tools:visibility="visible"
android:visibility="gone"
android:id="@+id/repository_name_text"
style="@style/SmallBlackButton"
tools:text="Repository name" />
</LinearLayout> </LinearLayout>
<ImageView <ImageView
@ -134,6 +141,7 @@
android:contentDescription="@string/download" android:contentDescription="@string/download"
android:focusable="true" android:focusable="true"
android:nextFocusLeft="@id/action_settings" android:nextFocusLeft="@id/action_settings"
android:nextFocusRight="@id/add_repo_button_imageview"
android:padding="12dp" android:padding="12dp"
tools:src="@drawable/ic_baseline_add_24" /> tools:src="@drawable/ic_baseline_add_24" />

View file

@ -10,13 +10,31 @@
style="@style/CheckLabel" style="@style/CheckLabel"
android:layout_gravity="center" android:layout_gravity="center"
tools:text="hello" /> tools:text="hello" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/action_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_tune_24"
android:visibility="gone"
tools:visibility="visible"
android:contentDescription="@string/title_settings" />
<ImageView <ImageView
android:id="@+id/pinicon" android:id="@+id/pinicon"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_gravity="end|center_vertical" android:layout_gravity="center_vertical"
android:src="@drawable/pin_ic" android:src="@drawable/pin_ic"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" tools:visibility="visible"
tools:ignore="RtlHardcoded" /> tools:ignore="RtlHardcoded" />
</LinearLayout>
</FrameLayout> </FrameLayout>

View file

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/profile_settings_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBlackBackground"
android:orientation="vertical">
<!-- <ScrollView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent">-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="@string/profile_settings"
android:textColor="?attr/textColor"
android:textSize="20sp"
android:textStyle="bold" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/profile_hide_negative_sources"
style="@style/SettingsItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/google_sans"
android:nextFocusLeft="@id/apply_btt"
android:nextFocusRight="@id/cancel_btt"
android:nextFocusDown="@id/profile_hide_error_sources"
android:text="@string/profile_hide_negative_sources"
app:drawableEndCompat="@null"
app:trackTint="@color/toggle_selector" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/profile_hide_error_sources"
style="@style/SettingsItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/google_sans"
android:nextFocusLeft="@id/apply_btt"
android:nextFocusRight="@id/cancel_btt"
android:nextFocusUp="@id/profile_hide_negative_sources"
android:nextFocusDown="@id/apply_btt"
android:text="@string/profile_hide_error_sources"
app:drawableEndCompat="@null"
app:trackTint="@color/toggle_selector" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="bottom"
android:gravity="bottom|end"
android:orientation="horizontal"
tools:ignore="UselessParent">
<com.google.android.material.button.MaterialButton
android:id="@+id/apply_btt"
style="@style/WhiteButton"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical|end"
android:nextFocusRight="@id/cancel_btt"
android:nextFocusUp="@id/subtitles_italic"
android:text="@string/sort_apply"
android:visibility="visible">
<requestFocus />
</com.google.android.material.button.MaterialButton>
<com.google.android.material.button.MaterialButton
android:id="@+id/cancel_btt"
style="@style/BlackButton"
android:layout_width="wrap_content"
android:layout_gravity="center_vertical|end"
android:nextFocusLeft="@id/apply_btt"
android:nextFocusUp="@id/subtitles_remove_captions"
android:text="@string/sort_cancel" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- </ScrollView>-->
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -102,6 +102,8 @@
<FrameLayout <FrameLayout
android:id="@+id/subtitle_holder" android:id="@+id/subtitle_holder"
android:clipChildren="false"
android:clipToPadding="false"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -169,6 +171,12 @@
android:layout_marginEnd="32dp" android:layout_marginEnd="32dp"
android:orientation="vertical"> android:orientation="vertical">
<TextClock
android:id="@+id/player_video_clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"/>
<LinearLayout <LinearLayout
android:id="@+id/player_video_title_holder" android:id="@+id/player_video_title_holder"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -756,4 +756,9 @@
<string name="video_singular">مقطع</string> <string name="video_singular">مقطع</string>
<string name="skip_type_preview">استعراض</string> <string name="skip_type_preview">استعراض</string>
<string name="player_is_live">البث قائم</string> <string name="player_is_live">البث قائم</string>
<string name="tv_layout_clock_settings">أظهر ساعة الوقت الحقيقي</string>
<string name="tv_layout_clock_settings_des">أظهر شاشة الوقت الحقيقي في قمة الشاشة. ينطبق على الصفحة الرئيسية و المشغل</string>
<string name="profile_settings">اعدادات الملف الشخصي</string>
<string name="profile_hide_negative_sources">أخفي المصادر صاحبة الأولوية السلبية</string>
<string name="profile_hide_error_sources">أخفي المصادر التي تحتوي أخطاء</string>
</resources> </resources>

View file

@ -125,7 +125,7 @@
<string name="continue_watching">Працягнуць прагляд</string> <string name="continue_watching">Працягнуць прагляд</string>
<string name="action_remove_watching">Выдаліць</string> <string name="action_remove_watching">Выдаліць</string>
<string name="action_open_watching">Больш інфармацыі</string> <string name="action_open_watching">Больш інфармацыі</string>
<string name="action_open_play">\@string/home_play</string> <string name="action_open_play">@string/home_play</string>
<string name="vpn_might_be_needed">Для карэктнай працы гэтага пастаўшчыка можа спатрэбіцца VPN</string> <string name="vpn_might_be_needed">Для карэктнай працы гэтага пастаўшчыка можа спатрэбіцца VPN</string>
<string name="vpn_torrent">Гэты пастаўшчык — Torrent, рэкамендуецца VPN</string> <string name="vpn_torrent">Гэты пастаўшчык — Torrent, рэкамендуецца VPN</string>
<string name="provider_info_meta">Вэб-сайт не пастаўляе метададзеных, загрузіць відэа не ўдасца, калі на сайце яго няма.</string> <string name="provider_info_meta">Вэб-сайт не пастаўляе метададзеных, загрузіць відэа не ўдасца, калі на сайце яго няма.</string>

View file

@ -3,7 +3,7 @@
<string name="result_poster_img_des">পোস্টার</string> <string name="result_poster_img_des">পোস্টার</string>
<string name="play_with_app_name">ক্লাউডস্ট্রিম দিয়ে চালান</string> <string name="play_with_app_name">ক্লাউডস্ট্রিম দিয়ে চালান</string>
<string name="title_home">হোম</string> <string name="title_home">হোম</string>
<string name="cast_format" formatted="true">অভিনয়ে %s</string> <string name="cast_format" formatted="true">অভিনয়ে: %s</string>
<string name="next_episode_time_day_format" formatted="true">%1$dদিন %2$dঘন্টা %3$dমিনিট</string> <string name="next_episode_time_day_format" formatted="true">%1$dদিন %2$dঘন্টা %3$dমিনিট</string>
<string name="next_episode_time_hour_format" formatted="true">%1$dঘন্টা %2$dমিনিট</string> <string name="next_episode_time_hour_format" formatted="true">%1$dঘন্টা %2$dমিনিট</string>
<string name="next_episode_time_min_format" formatted="true">%d মিনিট</string> <string name="next_episode_time_min_format" formatted="true">%d মিনিট</string>
@ -22,7 +22,7 @@
<string name="title_search">খুঁজুন</string> <string name="title_search">খুঁজুন</string>
<string name="title_downloads">ডাউনলোডসমূহ</string> <string name="title_downloads">ডাউনলোডসমূহ</string>
<string name="title_settings">সেটিংস</string> <string name="title_settings">সেটিংস</string>
<string name="app_dub_sub_episode_text_format" formatted="true">%1$s এপি %2$d</string> <string name="app_dub_sub_episode_text_format" formatted="true">%1$s পর্ব %2$d</string>
<string name="next_episode_format" formatted="true">পর্ব %d মুক্তির তারিখ</string> <string name="next_episode_format" formatted="true">পর্ব %d মুক্তির তারিখ</string>
<string name="result_share">শেয়ার</string> <string name="result_share">শেয়ার</string>
<string name="result_open_in_browser">ব্রাউজারে খুলুন</string> <string name="result_open_in_browser">ব্রাউজারে খুলুন</string>
@ -131,8 +131,8 @@
<string name="backup_failed">স্টোরেজ এর অনুমতি অনুপস্থিত। দয়া করে আবার চেষ্টা করুন।</string> <string name="backup_failed">স্টোরেজ এর অনুমতি অনুপস্থিত। দয়া করে আবার চেষ্টা করুন।</string>
<string name="settings_info">তথ্য</string> <string name="settings_info">তথ্য</string>
<string name="show_trailers_settings">ট্রেইলার প্রদর্শন করুন</string> <string name="show_trailers_settings">ট্রেইলার প্রদর্শন করুন</string>
<string name="kitsu_settings">কিটসু হতে পোস্টারসমূহ প্রদর্শন করুন</string> <string name="kitsu_settings">Kitsu থেকে পোস্টারসমূহ প্রদর্শন করুন</string>
<string name="automatic_plugin_updates">স্বয়ংক্রিয়ভাবে প্লাগিন এর হালনাগাদ</string> <string name="automatic_plugin_updates">স্বয়ংক্রিয় প্লাগইন আপডেট</string>
<string name="automatic_plugin_download">স্বয়ংক্রিয়ভাবে প্লাগিনসমুহের ডাউনলোড</string> <string name="automatic_plugin_download">স্বয়ংক্রিয়ভাবে প্লাগিনসমুহের ডাউনলোড</string>
<string name="category_updates">হালনাগাদ ও ব্যাকআপ</string> <string name="category_updates">হালনাগাদ ও ব্যাকআপ</string>
<string name="updates_settings">অ্যাপ এর হালনাগাদ দেখান</string> <string name="updates_settings">অ্যাপ এর হালনাগাদ দেখান</string>
@ -148,9 +148,9 @@
<string name="double_tap_to_seek_settings_des">সামনে বা পিছনের দিকে যেতে ডান বা বাম দিকে দুবার আলতো চাপুন</string> <string name="double_tap_to_seek_settings_des">সামনে বা পিছনের দিকে যেতে ডান বা বাম দিকে দুবার আলতো চাপুন</string>
<string name="delete_file">ফাইল ডিলিট</string> <string name="delete_file">ফাইল ডিলিট</string>
<string name="subs_default_reset_toast">মান ডিফল্ট এ রিসেট করুন</string> <string name="subs_default_reset_toast">মান ডিফল্ট এ রিসেট করুন</string>
<string name="updates_settings_des">স্টার্টআপে নতুন আপডেটের জন্য স্বয়ংক্রিয়ভাবে অনুসন্ধান করুন</string> <string name="updates_settings_des">স্টার্টআপে নতুন আপডেটের জন্য স্বয়ংক্রিয়ভাবে অনুসন্ধান করুন যোগ।</string>
<string name="movies_singular">সিনেমা</string> <string name="movies_singular">সিনেমা</string>
<string name="show_fillers_settings">এনিমে এর ফিলার পর্ব দেখায়</string> <string name="show_fillers_settings">অ্যানিমে ফিলার পর্ব প্রদর্শন</string>
<string name="tv_series">টিভি সিরিজ</string> <string name="tv_series">টিভি সিরিজ</string>
<string name="no_links_found_toast">লিংক পাওয়া যায়নি</string> <string name="no_links_found_toast">লিংক পাওয়া যায়নি</string>
<string name="benene_des">চা খাওয়ানো হয়েছে</string> <string name="benene_des">চা খাওয়ানো হয়েছে</string>
@ -174,7 +174,7 @@
<string name="delete">ডিলিট</string> <string name="delete">ডিলিট</string>
<string name="start">শুরু</string> <string name="start">শুরু</string>
<string name="cartoons">কার্টুন</string> <string name="cartoons">কার্টুন</string>
<string name="apk_installer_settings_des">কিছু ফোন নতুন প্যাকেজ ইনস্টলার সাপোর্ট করে না। যদি আপডেটগুলি ইনস্টল না হয় তবে পুরোনো পদ্ধতি ব্যবহার করে দেখুন</string> <string name="apk_installer_settings_des">Some devices do not support the new package installer. Try the legacy option if updates do not install</string>
<string name="no_subtitles">সাবটাইটেল নেই</string> <string name="no_subtitles">সাবটাইটেল নেই</string>
<string name="no_chromecast_support_toast">এই প্রোভাইডার ক্রোমকাস্ট সাপোর্ট করে না</string> <string name="no_chromecast_support_toast">এই প্রোভাইডার ক্রোমকাস্ট সাপোর্ট করে না</string>
<string name="advanced_search">উন্নত অনুসন্ধান</string> <string name="advanced_search">উন্নত অনুসন্ধান</string>
@ -204,7 +204,7 @@
<string name="anim">আমাদের তৈরি Anime দেখার অ্যাপ্লিকেশন</string> <string name="anim">আমাদের তৈরি Anime দেখার অ্যাপ্লিকেশন</string>
<string name="nsfw">18+</string> <string name="nsfw">18+</string>
<string name="anime">এনিমে</string> <string name="anime">এনিমে</string>
<string name="pref_filter_search_quality">অনুসন্ধান ফলাফলে নির্বাচিত ভিডিও কুয়ালিটি লুকান</string> <string name="pref_filter_search_quality">অনুসন্ধানের ফলে নির্বাচিত ভিডিওর মান লুকান</string>
<string name="app_storage">অ্যাপ</string> <string name="app_storage">অ্যাপ</string>
<string name="livestreams">লাইভস্ট্রিম</string> <string name="livestreams">লাইভস্ট্রিম</string>
<string name="apk_installer_settings">APK ইনস্টলার</string> <string name="apk_installer_settings">APK ইনস্টলার</string>
@ -353,4 +353,38 @@
<string name="play_from_beginning_img_des">শুরু থেকে চালু করুন</string> <string name="play_from_beginning_img_des">শুরু থেকে চালু করুন</string>
<string name="speech_recognition_unavailable">স্পিচ রিকগনিশন উপলব্ধ নেই</string> <string name="speech_recognition_unavailable">স্পিচ রিকগনিশন উপলব্ধ নেই</string>
<string name="begin_speaking">কথা বলা শুরু করুন…</string> <string name="begin_speaking">কথা বলা শুরু করুন…</string>
<string name="download_queue">ডাউনলোড তালিকা</string>
<string name="play_full_series_button">সম্পূর্ণ সিরিজ প্লে করুন</string>
<string name="torrent_info">এই ভিডিওটি একটি টরেন্ট, অর্থাৎ আপনার ভিডিও অ্যাক্টিভিটি ট্র্যাক করা সম্ভব।\nএগোনোর আগে টরেন্টিং সম্পর্কে ভালোভাবে বুঝে নিন।</string>
<string name="downloads_delete_select">ডিলিট করার জন্য আইটেম সিলেক্ট করুন</string>
<string name="downloads_empty">বর্তমানে কোনো ডাউনলোড নেই।</string>
<string name="queue_empty_message">বর্তমানে কোনো ডাউনলোড কিউতে নেই।</string>
<string name="offline_file">অফলাইনে দেখার জন্য উপলব্ধ</string>
<string name="select_all">সব সিলেক্ট করুন</string>
<string name="deselect_all">সব ডিসিলেক্ট করুন</string>
<string name="open_local_video">লোকাল ভিডিও খুলুন</string>
<string name="extra_brightness_settings">অতিরিক্ত ব্রাইটনেস</string>
<string name="extra_brightness_settings_des">ডিসপ্লে ব্রাইটনেস ১০০% ছাড়িয়ে গেলে ব্রাইটনেস ফিল্টার চালু করুন</string>
<string name="search_suggestions">সার্চ সাজেশন</string>
<string name="search_suggestions_des">টাইপ করার সময় সার্চ সাজেশন দেখান</string>
<string name="clear_suggestions">সাজেশন মুছে ফেলুন</string>
<string name="show_player_metadata_overlay">প্লেয়ার মেটাডেটা ওভারলে প্রদর্শন</string>
<string name="show_cast_in_details">কাস্ট প্যানেল প্রদর্শন</string>
<string name="install_prerelease">প্রাক-মুক্তি সংস্করণ ইনস্টলেশন</string>
<string name="prerelease_already_installed">প্রাক-মুক্তি সংস্করণ ইতোমধ্যে ইনস্টল রয়েছে।</string>
<string name="prerelease_install_failed">প্রাক-মুক্তি সংস্করণ ইনস্টল করতে সমস্যা হয়েছে।</string>
<string name="delete_format" formatted="true">(%1$d | %2$s) মুছুন</string>
<string name="test_warning">সাবধান</string>
<string name="delete_message_multiple" formatted="true">আপনি কি নিম্নলিখিত আইটেমগুলো স্থায়ীভাবে মুছতে চান?\n\n%s</string>
<string name="delete_files">ফাইল মুছুন</string>
<string name="delete_message_series_episodes" formatted="true">আপনি কি নিশ্চিত যে আপনি %1$s-এ নিচের এপিসোডগুলো স্থায়ীভাবে মুছে ফেলতে চান?\n\n%2$s</string>
<string name="delete_message_series_section" formatted="true">আপনি নিচের সিরিজগুলোর সব এপিসোডও স্থায়ীভাবে মুছে ফেলবেন:\n\n%s</string>
<string name="delete_message_series_only" formatted="true">আপনি কি নিশ্চিত যে আপনি নিচের সিরিজটির সব এপিসোড স্থায়ীভাবে মুছে ফেলতে চান?\n\n%s</string>
<string name="music_singular">সঙ্গীত</string>
<string name="audio_book_singular">অডিও বই</string>
<string name="custom_media_singular">মিডিয়া</string>
<string name="audio_singular">অডিও</string>
<string name="podcast_singular">পডকাস্ট</string>
<string name="video_singular">ভিডিও</string>
<string name="encoding_error">এনকোডিং ত্রুটি</string>
</resources> </resources>

View file

@ -123,7 +123,7 @@
<string name="continue_watching">Continua mirant</string> <string name="continue_watching">Continua mirant</string>
<string name="action_remove_watching">Eliminar</string> <string name="action_remove_watching">Eliminar</string>
<string name="action_open_watching">Més info</string> <string name="action_open_watching">Més info</string>
<string name="action_open_play">\@string/home_play</string> <string name="action_open_play">@string/home_play</string>
<string name="vpn_might_be_needed">Potser necessiteu una VPN per que aquest proveïdor funcioni correctament</string> <string name="vpn_might_be_needed">Potser necessiteu una VPN per que aquest proveïdor funcioni correctament</string>
<string name="vpn_torrent">Aquest proveïdor és un Torrent, es recomana fer servir una VPN</string> <string name="vpn_torrent">Aquest proveïdor és un Torrent, es recomana fer servir una VPN</string>
<string name="provider_info_meta">El lloc no proveeix metadades, la càrrega del video fallarà si no existeix al lloc.</string> <string name="provider_info_meta">El lloc no proveeix metadades, la càrrega del video fallarà si no existeix al lloc.</string>

View file

@ -754,4 +754,15 @@
<string name="video_singular">Video</string> <string name="video_singular">Video</string>
<string name="skip_type_preview">Náhled</string> <string name="skip_type_preview">Náhled</string>
<string name="player_is_live">Živě</string> <string name="player_is_live">Živě</string>
<string name="profile_settings">Nastavení profilu</string>
<string name="profile_hide_negative_sources">Skrýt zdroje s negativní prioritou</string>
<string name="profile_hide_error_sources">Skrýt zdroje s chybami</string>
<plurals name="links_hidden">
<item quantity="one">%d skrytý odkaz</item>
<item quantity="few">%d skryté odkazy</item>
<item quantity="many">%d skrytých odkazů</item>
<item quantity="other">%d skrytých odkazů</item>
</plurals>
<string name="tv_layout_clock_settings">Zobrazit hodiny s reálným časem</string>
<string name="tv_layout_clock_settings_des">Zobrazit hodiny s reálným časem v horní části obrazovky. Platí pro domovskou obrazovku a přehrávač</string>
</resources> </resources>

View file

@ -737,4 +737,9 @@
<string name="video_singular">Vídeo</string> <string name="video_singular">Vídeo</string>
<string name="skip_type_preview">Vista previa</string> <string name="skip_type_preview">Vista previa</string>
<string name="player_is_live">En Vivo</string> <string name="player_is_live">En Vivo</string>
<string name="tv_layout_clock_settings">Mostrar reloj en tiempo real</string>
<string name="tv_layout_clock_settings_des">Muestra un reloj en tiempo real en la parte superior de la pantalla. Se aplica a la página de inicio y al reproductor</string>
<string name="profile_settings">Configuración del perfil</string>
<string name="profile_hide_negative_sources">Ocultar fuentes con prioridad negativa</string>
<string name="profile_hide_error_sources">Ocultar fuentes con errores</string>
</resources> </resources>

View file

@ -225,7 +225,7 @@
<string name="live_singular">Livestream</string> <string name="live_singular">Livestream</string>
<string name="nsfw_singular">NSFW</string> <string name="nsfw_singular">NSFW</string>
<string name="other_singular">Altro</string> <string name="other_singular">Altro</string>
<string name="source_error">Errore sorgente</string> <string name="source_error">Errore fonte</string>
<string name="remote_error">Errore remoto</string> <string name="remote_error">Errore remoto</string>
<string name="render_error">Errore del renderer</string> <string name="render_error">Errore del renderer</string>
<string name="unexpected_error">Errore imprevisto del lettore</string> <string name="unexpected_error">Errore imprevisto del lettore</string>
@ -247,7 +247,7 @@
<string name="check_for_update">Controlla aggiornamenti</string> <string name="check_for_update">Controlla aggiornamenti</string>
<string name="video_lock">Blocca</string> <string name="video_lock">Blocca</string>
<string name="video_aspect_ratio_resize">Ridimensiona</string> <string name="video_aspect_ratio_resize">Ridimensiona</string>
<string name="video_source">Sorgente</string> <string name="video_source">Fonte</string>
<string name="video_skip_op">Salta OP</string> <string name="video_skip_op">Salta OP</string>
<string name="dont_show_again">Non mostrare di nuovo</string> <string name="dont_show_again">Non mostrare di nuovo</string>
<string name="skip_update">Salta questo aggiornamento</string> <string name="skip_update">Salta questo aggiornamento</string>
@ -346,7 +346,7 @@
<string name="actor_main">Protagonista</string> <string name="actor_main">Protagonista</string>
<string name="actor_supporting">Supporto</string> <string name="actor_supporting">Supporto</string>
<string name="actor_background">Secondario</string> <string name="actor_background">Secondario</string>
<string name="home_source">Sorgente</string> <string name="home_source">Fonte</string>
<string name="home_random">Casuale</string> <string name="home_random">Casuale</string>
<string name="coming_soon">Prossimamente…</string> <string name="coming_soon">Prossimamente…</string>
<string name="quality_cam">Cam</string> <string name="quality_cam">Cam</string>
@ -670,7 +670,7 @@
<string name="sort_episodes_date_oldest">Data di messa in onda (più vecchia)</string> <string name="sort_episodes_date_oldest">Data di messa in onda (più vecchia)</string>
<string name="sort_button_rating">Valutazione %s</string> <string name="sort_button_rating">Valutazione %s</string>
<string name="starting_plugin_update_manually">Avvio del processo di aggiornamento plugin!</string> <string name="starting_plugin_update_manually">Avvio del processo di aggiornamento plugin!</string>
<string name="plugins_updated_manually">%d plugin aggiornati con successo!</string> <string name="plugins_updated_manually">%d plugin aggiornati correttamente</string>
<string name="no_plugins_updated_manually">Nessun plugin è stato aggiornato.</string> <string name="no_plugins_updated_manually">Nessun plugin è stato aggiornato.</string>
<string name="player_notification_channel_name">Notifiche lettore</string> <string name="player_notification_channel_name">Notifiche lettore</string>
<string name="player_notification_channel_description">La notifica del lettore per controllare la riproduzione in background</string> <string name="player_notification_channel_description">La notifica del lettore per controllare la riproduzione in background</string>
@ -733,7 +733,7 @@
<string name="clear_suggestions">Cancella suggerimenti</string> <string name="clear_suggestions">Cancella suggerimenti</string>
<string name="show_cast_in_details">Mostra pannello cast</string> <string name="show_cast_in_details">Mostra pannello cast</string>
<string name="video_info">Info sui media</string> <string name="video_info">Info sui media</string>
<string name="source_name">Nome sorgente</string> <string name="source_name">Nome fonte</string>
<string name="extra_brightness_settings">Luminosità extra</string> <string name="extra_brightness_settings">Luminosità extra</string>
<string name="extra_brightness_settings_des">Attiva il filtro di luminosità quando viene superato il 100% della luminosità dello schermo</string> <string name="extra_brightness_settings_des">Attiva il filtro di luminosità quando viene superato il 100% della luminosità dello schermo</string>
<string name="extra_brightness_key">extra_brightness_enabled</string> <string name="extra_brightness_key">extra_brightness_enabled</string>
@ -753,10 +753,20 @@
<item quantity="many">%d download in coda</item> <item quantity="many">%d download in coda</item>
<item quantity="other">%d download in coda</item> <item quantity="other">%d download in coda</item>
</plurals> </plurals>
<string name="source_priority">Priorità sorgente</string> <string name="source_priority">Priorità fonti</string>
<string name="source_priority_help">Decidi come le sorgenti video devono essere ordinate nel lettore</string> <string name="source_priority_help">Decidi come le fonti video devono essere ordinate nel lettore</string>
<string name="show_player_metadata_overlay">Mostra sovrapposizione metadati lettore</string> <string name="show_player_metadata_overlay">Mostra sovrapposizione metadati lettore</string>
<string name="video_singular">Video</string> <string name="video_singular">Video</string>
<string name="skip_type_preview">Anteprima</string> <string name="skip_type_preview">Anteprima</string>
<string name="player_is_live">Live</string> <string name="player_is_live">Live</string>
<string name="profile_settings">Impostazioni profilo</string>
<string name="profile_hide_negative_sources">Nascondi fonti con priorità negativa</string>
<string name="profile_hide_error_sources">Nascondi fonti con errori</string>
<plurals name="links_hidden">
<item quantity="one">%d collegamento nascosto</item>
<item quantity="many">%d collegamenti nascosti</item>
<item quantity="other">%d collegamenti nascosti</item>
</plurals>
<string name="tv_layout_clock_settings">Mostra orologio in tempo reale</string>
<string name="tv_layout_clock_settings_des">Mostra un orologio in tempo reale nella parte superiore dello schermo. Si applica alla homepage e al lettore</string>
</resources> </resources>

View file

@ -730,4 +730,7 @@
<string name="source_priority">ソースの優先順位</string> <string name="source_priority">ソースの優先順位</string>
<string name="source_priority_help">プレイヤーでのビデオソースの並び順を設定します</string> <string name="source_priority_help">プレイヤーでのビデオソースの並び順を設定します</string>
<string name="show_player_metadata_overlay">プレイヤーメタデータオーバーレイを表示</string> <string name="show_player_metadata_overlay">プレイヤーメタデータオーバーレイを表示</string>
<string name="video_singular">動画</string>
<string name="skip_type_preview">プレビュー</string>
<string name="player_is_live">ライブ</string>
</resources> </resources>

View file

@ -25,18 +25,18 @@
<string name="sort_copy">Kopijuoti</string> <string name="sort_copy">Kopijuoti</string>
<string name="benene_des">Duoti bananai</string> <string name="benene_des">Duoti bananai</string>
<string name="home_more_info">Daugiau informacijos</string> <string name="home_more_info">Daugiau informacijos</string>
<string name="title_downloads">Atsiuntimai</string> <string name="title_downloads">Atsisiuntimai</string>
<string name="subs_auto_select_language">Automatiškai pasirinkti kalbą</string> <string name="subs_auto_select_language">Automatiškai pasirinkti kalbą</string>
<string name="error_loading_links_toast">Klaida kraunant nuorodas</string> <string name="error_loading_links_toast">Klaida kraunant nuorodas</string>
<string name="go_forward_30">+30</string> <string name="go_forward_30">+30</string>
<string name="download_done">Atsiuntimas baigtas</string> <string name="download_done">Atsisiuntimas baigtas</string>
<string name="continue_watching">Tęsti žiūrėjimą</string> <string name="continue_watching">Tęsti žiūrėjimą</string>
<string name="new_update_format" formatted="true">Rastas atnaujinimas!\n%1$s -&gt; %2$s</string> <string name="new_update_format" formatted="true">Rastas atnaujinimas!\n%1$s -&gt; %2$s</string>
<string name="subs_download_languages">Atsisiųsti kalbas</string> <string name="subs_download_languages">Atsisiųsti kalbas</string>
<string name="search_provider_text_providers">Ieškoti naudojant tiekėjus</string> <string name="search_provider_text_providers">Ieškoti naudojant tiekėjus</string>
<string name="go_back_img_des">Grįžti atgal</string> <string name="go_back_img_des">Grįžti atgal</string>
<string name="downloading">Siunčiama</string> <string name="downloading">Siunčiama</string>
<string name="episode_more_options_des">Daugiau pasirinkčiu</string> <string name="episode_more_options_des">Daugiau parinkčių</string>
<string name="play_episode">Paleisti seriją</string> <string name="play_episode">Paleisti seriją</string>
<string name="player_speed">Grotuvo greitis</string> <string name="player_speed">Grotuvo greitis</string>
<string name="benene_count_text">%d Bananai duoti kūrėjams</string> <string name="benene_count_text">%d Bananai duoti kūrėjams</string>
@ -45,7 +45,7 @@
<string name="result_tags">Žanrai</string> <string name="result_tags">Žanrai</string>
<string name="go_back_30">-30</string> <string name="go_back_30">-30</string>
<string name="episode_poster_img_des">Serijos plakatas</string> <string name="episode_poster_img_des">Serijos plakatas</string>
<string name="vpn_might_be_needed">Gali reikėti VPN šitam tiekėjui, kad veiktų teisingai</string> <string name="vpn_might_be_needed">Gali reikėti VPN šiam tiekėjui, kad veiktų teisingai</string>
<string name="search_hint_site" formatted="true">Ieškoti %s…</string> <string name="search_hint_site" formatted="true">Ieškoti %s…</string>
<string name="github">Github</string> <string name="github">Github</string>
<string name="benene_count_text_none">Nėra duotu bananų</string> <string name="benene_count_text_none">Nėra duotu bananų</string>
@ -66,7 +66,7 @@
<string name="cancel">Atšaukti</string> <string name="cancel">Atšaukti</string>
<string name="start">Pradėti</string> <string name="start">Pradėti</string>
<string name="cartoons_singular">Filmukas</string> <string name="cartoons_singular">Filmukas</string>
<string name="download_canceled">Atsiuntimas atšauktas</string> <string name="download_canceled">Atsisiuntimas atšauktas</string>
<string name="advanced_search">Išplėstinė paieška</string> <string name="advanced_search">Išplėstinė paieška</string>
<string name="empty_library_logged_in_message">Tuščias sąrašas. Pabandykite pasirinkti kitą sąrašą.</string> <string name="empty_library_logged_in_message">Tuščias sąrašas. Pabandykite pasirinkti kitą sąrašą.</string>
<string name="chromecast_subtitles_settings">Chromecast subtitrai</string> <string name="chromecast_subtitles_settings">Chromecast subtitrai</string>
@ -93,10 +93,10 @@
<string name="type_completed">Užbaigta</string> <string name="type_completed">Užbaigta</string>
<string name="use_system_brightness_settings_des">Naudoti sistemos ryškumą programos grotuve vietoj tamsumo</string> <string name="use_system_brightness_settings_des">Naudoti sistemos ryškumą programos grotuve vietoj tamsumo</string>
<string name="restore_failed_format" formatted="true">Nepavyko atstatyti duomenis iš failo %s</string> <string name="restore_failed_format" formatted="true">Nepavyko atstatyti duomenis iš failo %s</string>
<string name="play_trailer_button">Paleisti anonsa</string> <string name="play_trailer_button">Paleisti anonsą</string>
<string name="play_livestream_button">Paleisti gyva transliacija</string> <string name="play_livestream_button">Paleisti gyvą transliaciją</string>
<string name="no_episodes_found">Nerasta serijų</string> <string name="no_episodes_found">Nerasta serijų</string>
<string name="vpn_torrent">Šis tiekėjas yra iš Torrentų, VPN rekomenduojama naudoti</string> <string name="vpn_torrent">Šis tiekėjas yra iš Torrent\'ų, rekomenduojamas VPN</string>
<string name="test_failed">Nepavyko</string> <string name="test_failed">Nepavyko</string>
<string name="result_poster_img_des">Plakatas</string> <string name="result_poster_img_des">Plakatas</string>
<string name="popup_play_file">Paleisti failą</string> <string name="popup_play_file">Paleisti failą</string>
@ -108,21 +108,21 @@
<string name="redo_setup_process">Perdaryti nustatymo procesą</string> <string name="redo_setup_process">Perdaryti nustatymo procesą</string>
<string name="episodes_range">%1$d-%2$d</string> <string name="episodes_range">%1$d-%2$d</string>
<string name="benene">Duoti bananą kūrėjams</string> <string name="benene">Duoti bananą kūrėjams</string>
<string name="go_back">Sugryšti</string> <string name="go_back">Sugrįšti</string>
<string name="copy_link_toast">Nuoroda nukopijuota į iškarpinę</string> <string name="copy_link_toast">Nuoroda nukopijuota į iškarpinę</string>
<string name="search">Paieška</string> <string name="search">Paieška</string>
<string name="settings_info">Informacija</string> <string name="settings_info">Informacija</string>
<string name="skip_loading">Praleisti įkėlima</string> <string name="skip_loading">Praleisti įkėlimą</string>
<string name="home_info">Informacija</string> <string name="home_info">Informacija</string>
<string name="next_episode_format" formatted="true">Serija %d bus išleista</string> <string name="next_episode_format" formatted="true">Serija %d bus išleista</string>
<string name="sort_save">Išsaugoti</string> <string name="sort_save">Išsaugoti</string>
<string name="clipboard_too_large">Perdaug teksto. Nepavyko išsaugoti i iškarpynę.</string> <string name="clipboard_too_large">Perdaug teksto. Nepavyko išsaugoti i iškarpynę.</string>
<string name="download_failed">Atsiuntimas nepavyko</string> <string name="download_failed">Atsisiuntimas nepavyko</string>
<string name="result_share">Pasidalinti</string> <string name="result_share">Pasidalinti</string>
<string name="home_main_poster_img_des">Pagrindinis Plakatas</string> <string name="home_main_poster_img_des">Pagrindinis Plakatas</string>
<string name="pick_source">Šaltiniai</string> <string name="pick_source">Šaltiniai</string>
<string name="title_settings">Nustatymai</string> <string name="title_settings">Nustatymai</string>
<string name="title_search">Ieškoti</string> <string name="title_search">Paieška</string>
<string name="loading">Kraunama…</string> <string name="loading">Kraunama…</string>
<string name="action_remove_watching">Pašalinti</string> <string name="action_remove_watching">Pašalinti</string>
<string name="action_open_watching">Daugiau informacijos</string> <string name="action_open_watching">Daugiau informacijos</string>
@ -138,7 +138,7 @@
<string name="sort_close">Uždaryti</string> <string name="sort_close">Uždaryti</string>
<string name="action_add_to_bookmarks">Nustatyti žiūrėjimo statusą</string> <string name="action_add_to_bookmarks">Nustatyti žiūrėjimo statusą</string>
<string name="play_with_app_name">Paleisti su CloudStream</string> <string name="play_with_app_name">Paleisti su CloudStream</string>
<string name="subs_subtitle_elevation">Subtitrų iškėlimas</string> <string name="subs_subtitle_elevation">Subtitrų lygis</string>
<string name="episodes">Serijos</string> <string name="episodes">Serijos</string>
<string name="cast_format" formatted="true">Skleisti: %s</string> <string name="cast_format" formatted="true">Skleisti: %s</string>
<string name="season">Sezonas</string> <string name="season">Sezonas</string>
@ -248,4 +248,51 @@
<string name="confirm_exit_dialog">Ar tikrai norite išeiti?</string> <string name="confirm_exit_dialog">Ar tikrai norite išeiti?</string>
<string name="action_remove_from_watched">Pašalinti iš žiūrimų</string> <string name="action_remove_from_watched">Pašalinti iš žiūrimų</string>
<string name="audio_tracks">Garso takelis</string> <string name="audio_tracks">Garso takelis</string>
<string name="filler" formatted="true">Užpildymas</string>
<string name="duration_format" formatted="true">%d min</string>
<string name="title_home">Namai</string>
<string name="download_queue">Atsisiuntimų eilė</string>
<string name="speech_recognition_unavailable">Balso atpažinimas nepasiekiamas</string>
<string name="begin_speaking">Pradėkite kalbėti…</string>
<string name="type_dropped">Nežiūrimas</string>
<string name="play_full_series_button">Paleisti visą seriją</string>
<string name="torrent_info">Šis įrašas yra Torrent\'e, tai reiškia, kad tavo įrašo veikla gali būti sekama. Įsitikinkite, kad suprantate Torrenting prieš tęsiant.</string>
<string name="reload_error">Atkurti ryšį…</string>
<string name="downloads_delete_select">Pasirinkite elementus, kuriuos norite pašalinti</string>
<string name="downloads_empty">Šiuo metu atsisiuntimų nėra.</string>
<string name="queue_empty_message">Šiuo metu atsisiuntimų eilėje nėra.</string>
<string name="offline_file">Pasiekiama žiūrėti neprisijungus</string>
<string name="select_all">Pasirinkti viską</string>
<string name="deselect_all">Panaikinti visus pasirinkimus</string>
<string name="stream">Tinklo srautas</string>
<string name="open_local_video">Atidaryti vietinį video</string>
<string name="links_reloaded_toast">Nuorodos perkrautos</string>
<string name="app_subbed_text">Subtitrai</string>
<string name="repo_copy_label">Repozitorijos pavadinimas ir adresas</string>
<string name="toast_copied">nukopijuota!</string>
<string name="subscribe_tooltip">Naujos serijos pranešimas</string>
<string name="result_search_tooltip">Ieškoti kituose plėtiniuose</string>
<string name="recommendations_tooltip">Rodyti rekomendacijas</string>
<string name="subs_outline_color">Apvado spalva</string>
<string name="subs_edge_type">Rėmelio tipas</string>
<string name="search_provider_text_types">Ieškoti naudojant tipus</string>
<string name="subs_hold_to_reset_to_default">Laikyti ilgai, kad sugražinti pradinius nustatymus</string>
<string name="subs_import_text" formatted="true">Įkelti šriftus sudedant juos į %s</string>
<string name="provider_info_meta">Metaduomenys nesuteikiamos svetainės, vaizdo įkėlimas nepavyks, jeigu jo nebus svetainėje.</string>
<string name="torrent_plot">Aprašymas</string>
<string name="normal_no_plot">Nėra siužeto aprašymo</string>
<string name="torrent_no_plot">Aprašymas nerastas</string>
<string name="show_log_cat">Rodyti Logcat</string>
<string name="picture_in_picture">Vaizdas vaizde</string>
<string name="picture_in_picture_des">Tęsia atkūrimą mažame grotuve virš kitų programų</string>
<string name="player_size_settings">Grotuvo dydžio pakeitimo mygtukas</string>
<string name="player_size_settings_des">Pašalinti juodas paraštes</string>
<string name="player_subtitles_settings">Subtitrai</string>
<string name="chromecast_subtitles_settings_des">Chromecast subtitrų nustatymai</string>
<string name="eigengraumode_settings">Atkūrimo sparta</string>
<string name="speed_setting_summary">Prideda greičio pasirinkimą grotuve</string>
<string name="swipe_to_seek_settings">Braukite, kas ieškotumėte</string>
<string name="swipe_to_seek_settings_des">Braukite į šonus, kad kontroliuotumėte padėtį vaizdo įraše</string>
<string name="swipe_to_change_settings">Braukite, kad pakeistumėte nustatymus</string>
<string name="swipe_to_change_settings_des">Braukite aukštyn arba žemyn ekrano kairėje arba dešinėje, jei norite pakeisti ryškumą arba garsą</string>
</resources> </resources>

View file

@ -287,12 +287,12 @@
<string name="pref_category_defaults">Parasts</string> <string name="pref_category_defaults">Parasts</string>
<string name="pref_category_looks">Izskats</string> <string name="pref_category_looks">Izskats</string>
<string name="pref_category_ui_features">Funkcijas</string> <string name="pref_category_ui_features">Funkcijas</string>
<string name="category_general">Ģenerāls</string> <string name="category_general">Vispārīgie</string>
<string name="random_button_settings">Randomā poga</string> <string name="random_button_settings">Randomā poga</string>
<string name="random_button_settings_desc">Rādīt izlases pogu Sākums un Bibliotēka sadaļās</string> <string name="random_button_settings_desc">Rādīt izlases pogu Sākums un Bibliotēka sadaļās</string>
<string name="provider_lang_settings">Papildinājuma valodas</string> <string name="provider_lang_settings">Papildinājuma valodas</string>
<string name="app_layout">Lietotnes izkārtojums</string> <string name="app_layout">Lietotnes izkārtojums</string>
<string name="preferred_media_settings">Izvēlētā media</string> <string name="preferred_media_settings">Vēlamie multimediji</string>
<string name="enable_nsfw_on_providers">Iespējot nepiedienīgu, izaicinošu saturu (NSFW) atbalstītajos papildinājumos</string> <string name="enable_nsfw_on_providers">Iespējot nepiedienīgu, izaicinošu saturu (NSFW) atbalstītajos papildinājumos</string>
<string name="subtitles_encoding">Subtitru kodējums</string> <string name="subtitles_encoding">Subtitru kodējums</string>
<string name="category_providers">Devēji</string> <string name="category_providers">Devēji</string>
@ -372,7 +372,7 @@
<string name="error">Kļūda</string> <string name="error">Kļūda</string>
<string name="subtitles_remove_captions">Noņemt slēgtos parakstus no subtitriem</string> <string name="subtitles_remove_captions">Noņemt slēgtos parakstus no subtitriem</string>
<string name="subtitles_remove_bloat">Noņemt lieko no subtitriem (piemēram, reklāmu)</string> <string name="subtitles_remove_bloat">Noņemt lieko no subtitriem (piemēram, reklāmu)</string>
<string name="subtitles_filter_lang">Filtrēt pēc vēlamās multivides valodas</string> <string name="subtitles_filter_lang">Atlasīt pēc vēlamās multimediju valodas</string>
<string name="extras">Ekstras</string> <string name="extras">Ekstras</string>
<string name="trailer">Treileris</string> <string name="trailer">Treileris</string>
<string name="network_adress_example">https://piemērs.com/piemērs.mp4</string> <string name="network_adress_example">https://piemērs.com/piemērs.mp4</string>
@ -382,7 +382,7 @@
<string name="previous">Iepriekšējais</string> <string name="previous">Iepriekšējais</string>
<string name="skip_setup">Izlaist uzstādīšanu</string> <string name="skip_setup">Izlaist uzstādīšanu</string>
<string name="app_layout_subtext">Mainiet lietotnes izskatu, lai tā atbilstu savai ierīcei</string> <string name="app_layout_subtext">Mainiet lietotnes izskatu, lai tā atbilstu savai ierīcei</string>
<string name="preferred_media_subtext">Ko tu vēlies redzēt</string> <string name="preferred_media_subtext">Ko jūs vēlētos skatīt</string>
<string name="setup_done">Pabeigts</string> <string name="setup_done">Pabeigts</string>
<string name="extensions">Papildinājumi</string> <string name="extensions">Papildinājumi</string>
<string name="add_repository">Pievienot repozitoriju</string> <string name="add_repository">Pievienot repozitoriju</string>
@ -607,4 +607,11 @@
<string name="delete_message_series_only" formatted="true">Vai tiešām vēlaties neatgriezeniski dzēst visas šī seriāla, raidījuma epizodes?\n\n%s</string> <string name="delete_message_series_only" formatted="true">Vai tiešām vēlaties neatgriezeniski dzēst visas šī seriāla, raidījuma epizodes?\n\n%s</string>
<string name="queue_empty_message">Pašlaik nav nevienas rindā ievietotas lejupielādes.</string> <string name="queue_empty_message">Pašlaik nav nevienas rindā ievietotas lejupielādes.</string>
<string name="open_local_video">Atvērt vietējo video</string> <string name="open_local_video">Atvērt vietējo video</string>
<string name="custom_media_singular">Multimedija</string>
<string name="video_info">Multimediju informācija</string>
<string name="torrent_preferred_media">Iespējojiet torrentu Iestatījumi/Pakalpojumu sniedzēji/Vēlamie multimediji sadaļā</string>
<string name="subscribe_tooltip">Paziņojums par jaunu epizodi</string>
<string name="extra_brightness_settings">Papildu spilgtums</string>
<string name="extra_brightness_key">Papildu spilgtums iespējots</string>
<string name="search_suggestions">Meklēšanas ieteikumi</string>
</resources> </resources>

View file

@ -677,4 +677,22 @@
<string name="confirm_before_exiting_title">Bevestig voor afsluiten</string> <string name="confirm_before_exiting_title">Bevestig voor afsluiten</string>
<string name="confirm_before_exiting_desc">Toon dialoogvenster voordat de app wordt afgesloten</string> <string name="confirm_before_exiting_desc">Toon dialoogvenster voordat de app wordt afgesloten</string>
<string name="subs_edge_size">Randgrote</string> <string name="subs_edge_size">Randgrote</string>
<string name="show_player_metadata_overlay">Laat Speler Metadata Overlay zien</string>
<string name="device_pin_error_message">Kon de apparaat PIN niet vinden, probeer locale authenticatie</string>
<string name="torrent_preferred_media">Zet torrent aan in Instellingen/Providers/Media voorkeur</string>
<string name="torrent_not_accepted">Herstart de app en accepteer de Stream Torrent pop-up om verder te gaan.</string>
<string name="update_plugins_manually">Handmatige Update Knop</string>
<string name="biometric_setting_summary">Open de app met Vingerafdruk, Face ID, PIN, Pattern en Wachtwoord.</string>
<string name="preview_seekbar">Seekbar preview</string>
<string name="preview_seekbar_desc">Zet preview thumbnail aan op seekbar</string>
<string name="software_decoding">Software decodering</string>
<string name="software_decoding_desc">Software decodering staat de mogelijkheid toe om de speler videobestanden af te laten spelen op jouw apparaat, maar het kan een haperige of onstabiele kijkervaring zorgen op hoge resolutie.</string>
<string name="volume_exceeded_100">Volume heeft de 100% overschreden</string>
<string name="update_plugins">Update Plugins</string>
<string name="no_plugins_updated_manually">Geen plugins zijn geupdate.</string>
<string name="player_notification_channel_name">Speler meldingen</string>
<string name="player_notification_channel_description">De speler melding om de kijkervaring van de achtergrond de besturen</string>
<string name="subtitles_from_online">Online</string>
<string name="download_parallel_settings_des">Hoeveel verschillende items kunnen in parallel gedownload worden</string>
<string name="parallel_downloads">Parallel downloads</string>
</resources> </resources>

View file

@ -649,7 +649,7 @@
<string name="sort_episodes_number_desc">Odcinek (malejąco)</string> <string name="sort_episodes_number_desc">Odcinek (malejąco)</string>
<string name="sort_episodes_rating_high_low">Ocena (najwyższa)</string> <string name="sort_episodes_rating_high_low">Ocena (najwyższa)</string>
<string name="update_plugins">Zaktualizuj wtyczki</string> <string name="update_plugins">Zaktualizuj wtyczki</string>
<string name="plugins_updated_manually">Pomyślnie zaktualizowano wtyczki: %d!</string> <string name="plugins_updated_manually">Pomyślnie zaktualizowano wtyczki: %d</string>
<string name="no_plugins_updated_manually">Nie zaktualizowano żadnych wtyczek.</string> <string name="no_plugins_updated_manually">Nie zaktualizowano żadnych wtyczek.</string>
<string name="update_plugins_manually">Zaktualizuj wtyczki ręcznie</string> <string name="update_plugins_manually">Zaktualizuj wtyczki ręcznie</string>
<string name="starting_plugin_update_manually">Rozpoczęcie procesu aktualizacji wtyczek!</string> <string name="starting_plugin_update_manually">Rozpoczęcie procesu aktualizacji wtyczek!</string>
@ -742,4 +742,15 @@
<string name="video_singular">Wideo</string> <string name="video_singular">Wideo</string>
<string name="skip_type_preview">Zapowiedź</string> <string name="skip_type_preview">Zapowiedź</string>
<string name="player_is_live">Na żywo</string> <string name="player_is_live">Na żywo</string>
<string name="profile_settings">Ustawienia profilu</string>
<string name="profile_hide_negative_sources">Ukryj źródła z negatywnym priorytetem</string>
<string name="profile_hide_error_sources">Ukryj źródła z błędami</string>
<plurals name="links_hidden">
<item quantity="one">%d ukryty odnośnik</item>
<item quantity="few">%d ukryte odnośniki</item>
<item quantity="many">%d ukrytych odnośników</item>
<item quantity="other">%d ukrytych odnośników</item>
</plurals>
<string name="tv_layout_clock_settings">Pokaż zegar czasu rzeczywistego</string>
<string name="tv_layout_clock_settings_des">Wyświetl zegar czasu rzeczywistego u góry ekranu. Dotyczy strony głównej i odtwarzacza</string>
</resources> </resources>

View file

@ -117,7 +117,7 @@
<string name="subs_font_size">Madhësia e shkrimit</string> <string name="subs_font_size">Madhësia e shkrimit</string>
<string name="search_provider_text_providers">Kërko duke përdorur ofruesit</string> <string name="search_provider_text_providers">Kërko duke përdorur ofruesit</string>
<string name="search_provider_text_types">Kërko duke përdorur tipet</string> <string name="search_provider_text_types">Kërko duke përdorur tipet</string>
<string name="benene_count_text">%d Banane të dhëna per developer-at</string> <string name="benene_count_text">%d Banane të dhëna për developer-at</string>
<string name="benene_count_text_none">Asnjë Banane e dhënë</string> <string name="benene_count_text_none">Asnjë Banane e dhënë</string>
<string name="subs_auto_select_language">Zgjedhje automatike e gjuhës</string> <string name="subs_auto_select_language">Zgjedhje automatike e gjuhës</string>
<string name="subs_download_languages">Shkarko gjuhët</string> <string name="subs_download_languages">Shkarko gjuhët</string>
@ -127,7 +127,7 @@
<string name="continue_watching">Vazhdo shikimin</string> <string name="continue_watching">Vazhdo shikimin</string>
<string name="action_remove_watching">Hiq</string> <string name="action_remove_watching">Hiq</string>
<string name="action_open_watching">Më shumë informacion</string> <string name="action_open_watching">Më shumë informacion</string>
<string name="action_open_play">\@string/home_play</string> <string name="action_open_play">@string/home_play</string>
<string name="vpn_might_be_needed">Një VPN mund të nevojitet që ky ofrues të funksionojë në rregull</string> <string name="vpn_might_be_needed">Një VPN mund të nevojitet që ky ofrues të funksionojë në rregull</string>
<string name="vpn_torrent">Ky ofrues është Torrent, rekomandohet një VPN</string> <string name="vpn_torrent">Ky ofrues është Torrent, rekomandohet një VPN</string>
<string name="provider_info_meta">Metadata nuk ofrohet nga kjo faqe, ngarkimi i videos do të dështojë nëse nuk ekziston në këtë faqe.</string> <string name="provider_info_meta">Metadata nuk ofrohet nga kjo faqe, ngarkimi i videos do të dështojë nëse nuk ekziston në këtë faqe.</string>
@ -216,7 +216,7 @@
<string name="season_format">%1$s %2$d%3$s</string> <string name="season_format">%1$s %2$d%3$s</string>
<string name="no_season">Asnje sezon</string> <string name="no_season">Asnje sezon</string>
<string name="episode">Episodi</string> <string name="episode">Episodi</string>
<string name="episodes">Episodet</string> <string name="episodes">Episode</string>
<string name="episodes_range">%1$d-%2$d</string> <string name="episodes_range">%1$d-%2$d</string>
<string name="episode_format" formatted="true">%1$d %2$s</string> <string name="episode_format" formatted="true">%1$d %2$s</string>
<string name="episode_upcoming_format" formatted="true">Vazhdon në %s</string> <string name="episode_upcoming_format" formatted="true">Vazhdon në %s</string>
@ -679,7 +679,7 @@
<string name="update_plugins">Përditëso shtesat</string> <string name="update_plugins">Përditëso shtesat</string>
<string name="update_plugins_manually">Përditëso shtesat manualisht</string> <string name="update_plugins_manually">Përditëso shtesat manualisht</string>
<string name="starting_plugin_update_manually">Filloi procesi i përditësimit të shtesave!</string> <string name="starting_plugin_update_manually">Filloi procesi i përditësimit të shtesave!</string>
<string name="plugins_updated_manually">%d Shtes(at) u përditësuan me sukses!</string> <string name="plugins_updated_manually">%d Shtes(a) u përditësuan me sukses</string>
<string name="no_plugins_updated_manually">Nuk u përditësua asnjë shtesë.</string> <string name="no_plugins_updated_manually">Nuk u përditësua asnjë shtesë.</string>
<string name="player_notification_channel_name">Njoftimet e luajtësit</string> <string name="player_notification_channel_name">Njoftimet e luajtësit</string>
<string name="player_notification_channel_description">Njoftimi për kontrollin e luajtjes nga sfondi</string> <string name="player_notification_channel_description">Njoftimi për kontrollin e luajtjes nga sfondi</string>
@ -735,4 +735,13 @@
<item quantity="other">%d shkarkime në radhë</item> <item quantity="other">%d shkarkime në radhë</item>
</plurals> </plurals>
<string name="player_is_live">Live</string> <string name="player_is_live">Live</string>
<string name="profile_settings">Cilësimet e profil-it</string>
<string name="profile_hide_negative_sources">Fshih burimet me prioritet negativ</string>
<string name="profile_hide_error_sources">Fshih burimet me error-e</string>
<plurals name="links_hidden">
<item quantity="one">%d link i fshehur</item>
<item quantity="other">%d linqe të fshehura</item>
</plurals>
<string name="tv_layout_clock_settings">Shfaq orën në kohë reale</string>
<string name="tv_layout_clock_settings_des">Shfaq një orë në krye të ekranit. Aplikohet në faqen kryesore dhe në luajtës</string>
</resources> </resources>

View file

@ -735,4 +735,13 @@
<string name="video_singular">Video</string> <string name="video_singular">Video</string>
<string name="skip_type_preview">Förhandsvisning</string> <string name="skip_type_preview">Förhandsvisning</string>
<string name="player_is_live">Live</string> <string name="player_is_live">Live</string>
<string name="tv_layout_clock_settings">Visa realtidsklocka</string>
<string name="tv_layout_clock_settings_des">Visa en realtidsklocka högst upp på skärmen. Gäller startsidan och spelaren</string>
<string name="profile_settings">Profilinställningar</string>
<string name="profile_hide_negative_sources">Dölj källor med negativ prioritet</string>
<string name="profile_hide_error_sources">Dölj källor med fel</string>
<plurals name="links_hidden">
<item quantity="one">%d dold länk</item>
<item quantity="other">%d dolda länkar</item>
</plurals>
</resources> </resources>

View file

@ -652,7 +652,7 @@
<string name="update_plugins">செருகுநிரல்களைப் புதுப்பிக்கவும்</string> <string name="update_plugins">செருகுநிரல்களைப் புதுப்பிக்கவும்</string>
<string name="update_plugins_manually">செருகுநிரல்களை கைமுறையாக புதுப்பிக்கவும்</string> <string name="update_plugins_manually">செருகுநிரல்களை கைமுறையாக புதுப்பிக்கவும்</string>
<string name="starting_plugin_update_manually">சொருகி புதுப்பிப்பு செயல்முறையைத் தொடங்குகிறது!</string> <string name="starting_plugin_update_manually">சொருகி புதுப்பிப்பு செயல்முறையைத் தொடங்குகிறது!</string>
<string name="plugins_updated_manually">வெற்றிகரமாக புதுப்பிக்கப்பட்டது %d சொருகி (கள்)!</string> <string name="plugins_updated_manually">%d செருகுநிரல்(கள்) வெற்றிகரமாக புதுப்பிக்கப்பட்டது</string>
<string name="no_plugins_updated_manually">செருகுநிரல்கள் எதுவும் புதுப்பிக்கப்படவில்லை.</string> <string name="no_plugins_updated_manually">செருகுநிரல்கள் எதுவும் புதுப்பிக்கப்படவில்லை.</string>
<string name="player_notification_channel_name">பிளேயர் அறிவிப்புகள்</string> <string name="player_notification_channel_name">பிளேயர் அறிவிப்புகள்</string>
<string name="player_notification_channel_description">பின்னணியில் இருந்து பின்னணியைக் கட்டுப்படுத்துவதற்கான பிளேயர் அறிவிப்பு</string> <string name="player_notification_channel_description">பின்னணியில் இருந்து பின்னணியைக் கட்டுப்படுத்துவதற்கான பிளேயர் அறிவிப்பு</string>
@ -731,4 +731,17 @@
<item quantity="one">%d பதிவிறக்கம் வரிசையில் உள்ளது</item> <item quantity="one">%d பதிவிறக்கம் வரிசையில் உள்ளது</item>
<item quantity="other">%d பதிவிறக்கங்கள் வரிசையில் உள்ளன</item> <item quantity="other">%d பதிவிறக்கங்கள் வரிசையில் உள்ளன</item>
</plurals> </plurals>
<string name="show_player_metadata_overlay">பிளேயர் மேனிலை தரவு மேலடுக்கைக் காட்டு</string>
<string name="video_singular">ஒளிதோற்றம்</string>
<string name="tv_layout_clock_settings">உண்மையான நேர கடிகாரத்தைக் காட்டு</string>
<string name="tv_layout_clock_settings_des">திரையின் மேற்புறத்தில் நிகழ் நேர கடிகாரத்தைக் காட்டு. முகப்புப்பக்கம் மற்றும் பிளேயருக்குப் பொருந்தும்</string>
<string name="skip_type_preview">முன்னோட்டம்</string>
<string name="profile_settings">சுயவிவர அமைப்புகள்</string>
<string name="profile_hide_negative_sources">எதிர்மறையான முன்னுரிமையுடன் ஆதாரங்களை மறை</string>
<string name="profile_hide_error_sources">பிழைகளுடன் ஆதாரங்களை மறைக்கவும்</string>
<plurals name="links_hidden">
<item quantity="one">%d மறைக்கப்பட்ட இணைப்பு</item>
<item quantity="other">%d மறைக்கப்பட்ட இணைப்புகள்</item>
</plurals>
<string name="player_is_live">வாழ்க</string>
</resources> </resources>

View file

@ -661,7 +661,7 @@
<string name="sort_button_date">Tarih %s</string> <string name="sort_button_date">Tarih %s</string>
<string name="update_plugins">Eklentileri Güncelle</string> <string name="update_plugins">Eklentileri Güncelle</string>
<string name="starting_plugin_update_manually">Eklenti güncellemesi başlıyor!</string> <string name="starting_plugin_update_manually">Eklenti güncellemesi başlıyor!</string>
<string name="plugins_updated_manually">%d eklenti başarıyla güncellendi!</string> <string name="plugins_updated_manually">%d eklenti başarıyla güncellendi</string>
<string name="no_plugins_updated_manually">Hiçbir eklenti güncellenmedi.</string> <string name="no_plugins_updated_manually">Hiçbir eklenti güncellenmedi.</string>
<string name="update_plugins_manually">Eklentileri el ile güncelle</string> <string name="update_plugins_manually">Eklentileri el ile güncelle</string>
<string name="player_notification_channel_description">Oynatıcı bildirimi arka planda oynatmasını kontrol etmek içindir</string> <string name="player_notification_channel_description">Oynatıcı bildirimi arka planda oynatmasını kontrol etmek içindir</string>
@ -749,4 +749,13 @@
<string name="player_is_live">Canlı</string> <string name="player_is_live">Canlı</string>
<string name="skip_type_preview">Ön Gösterim</string> <string name="skip_type_preview">Ön Gösterim</string>
<string name="video_singular">Video</string> <string name="video_singular">Video</string>
<string name="tv_layout_clock_settings">Gerçek zamanlı saati göster</string>
<string name="tv_layout_clock_settings_des">Ekranın üst kısmında gerçek zamanlı bir saat göster. Ana sayfa ve oynatıcı için uygulanır</string>
<string name="profile_settings">Profil ayarları</string>
<string name="profile_hide_negative_sources">Eksi önceliğe sahip kaynakları gizle</string>
<string name="profile_hide_error_sources">Hatalı kaynakları gizle</string>
<plurals name="links_hidden">
<item quantity="one">%d gizli bağlantı</item>
<item quantity="other">%d gizli bağlantı</item>
</plurals>
</resources> </resources>

View file

@ -646,7 +646,7 @@
<string name="sort_button_episode">Еп. %s</string> <string name="sort_button_episode">Еп. %s</string>
<string name="sort_button_date">Дата %s</string> <string name="sort_button_date">Дата %s</string>
<string name="update_plugins">Оновити розширення</string> <string name="update_plugins">Оновити розширення</string>
<string name="plugins_updated_manually">Успішно оновлено %d розширення(-ь)!</string> <string name="plugins_updated_manually">Успішно оновлено %d розширення(-ь)</string>
<string name="update_plugins_manually">Оновити розширення вручну</string> <string name="update_plugins_manually">Оновити розширення вручну</string>
<string name="starting_plugin_update_manually">Починається оновлення розширень!</string> <string name="starting_plugin_update_manually">Починається оновлення розширень!</string>
<string name="no_plugins_updated_manually">Не оновлено жодного розширення.</string> <string name="no_plugins_updated_manually">Не оновлено жодного розширення.</string>
@ -739,4 +739,15 @@
<string name="video_singular">Відео</string> <string name="video_singular">Відео</string>
<string name="skip_type_preview">Передперегляд</string> <string name="skip_type_preview">Передперегляд</string>
<string name="player_is_live">Наживо</string> <string name="player_is_live">Наживо</string>
<string name="tv_layout_clock_settings">Показувати поточний час</string>
<string name="tv_layout_clock_settings_des">Показувати поточний час у верхній частині екрана (на головній та у програвачі)</string>
<string name="profile_settings">Налаштування профілю</string>
<string name="profile_hide_negative_sources">Приховати джерела з від’ємним пріоритетом</string>
<string name="profile_hide_error_sources">Приховати джерела з помилками</string>
<plurals name="links_hidden">
<item quantity="one">%d приховане посилання</item>
<item quantity="few">%d приховані посилання</item>
<item quantity="many">%d прихованих посилань</item>
<item quantity="other">%d прихованих посилань</item>
</plurals>
</resources> </resources>

Some files were not shown because too many files have changed in this diff Show more