diff --git a/README.md b/README.md index 4e68768a9..e5bedd66f 100644 --- a/README.md +++ b/README.md @@ -126,21 +126,13 @@ To enable global voice search, an additional app must be installed alongside Sma If you want to support my developments you are welcome to buy me a cup of coffee :) - -> [**Patreon**](https://www.patreon.com/smarttube) +> [**Patreon (Visa, Mastercard, PayPal)**](https://www.patreon.com/smarttube) > **PayPal**: firsthash at gmail.com > **BTC**: 1JAT5VVWarVBkpVbNDn8UA8HXNdrukuBSx > **LTC**: ltc1qgc24eq9jl9cq78qnd5jpqhemkajg9vudwyd8pw > **ETH**: 0xe455E21a085ae195a097cd4F456051A9916A5064 > **ETC**: 0x209eCd33Fa61fA92167595eB3Aea92EE1905c815 > **XMR**: 48QsMjqfkeW54vkgKyRnjodtYxdmLk6HXfTWPSZoaFPEDpoHDwFUciGCe1QC9VAeGrgGw4PKNAksX9RW7myFqYJQDN5cHGT -> **BNB**: bnb1amjr7fauftxxyhe4f95280vklctj243k9u55fq -> **DOGE**: DBnqJwJs2GJBxrCDsi5bXwSmjnz8uGdUpB -> **eUSDT**: 0xe455e21a085ae195a097cd4f456051a9916a5064 ## Support @@ -161,8 +153,9 @@ The international group is in **English only**. But don't worry if your English SmartTubeNext is developed single-handedly by Yurii; there is no larger team or company behind this. This is an open source, hobby project. Several others have helped with translations, some of which can be seen on [Github](https://github.com/yuliskov/SmartTubeNext/graphs/contributors), some have sent their translations directly to Yurii. There are also helpful people in the support chat. ## Build - -To build, install and run a debug version, run this from the root of the project: + +NOTE: OpenJDK 14 or older (!) is required. Newer JDK could cause the app crash! +To build, install and run a debug version, run this commands: ``` git clone https://github.com/yuliskov/SmartTubeNext.git diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/data/Video.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/data/Video.java index 65a59458e..378187f4a 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/data/Video.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/data/Video.java @@ -232,7 +232,7 @@ public final class Video implements Parcelable { return secondTitle != null ? secondTitle : metadataSecondTitle; } - public String extractAuthor() { + public String getAuthor() { if (author != null) { return author; } @@ -240,15 +240,15 @@ public final class Video implements Parcelable { return extractAuthor(secondTitle != null ? secondTitle : metadataSecondTitle); } - private static String extractAuthor(String info) { + private static String extractAuthor(String secondTitle) { String result = null; - if (info != null) { - info = info.replace(TERTIARY_TEXT_DELIM + " LIVE", ""); // remove special marks - String[] split = info.split(TERTIARY_TEXT_DELIM); + if (secondTitle != null) { + secondTitle = secondTitle.replace(TERTIARY_TEXT_DELIM + " LIVE", ""); // remove special marks + String[] split = secondTitle.split(TERTIARY_TEXT_DELIM); if (split.length <= 1) { - result = info; + result = secondTitle; } else { // First part may be a special label (4K, Stream, New etc) // Two cases to detect label: 1) Description is long (4 items); 2) First item of info is too short (2 letters) @@ -264,7 +264,7 @@ public final class Video implements Parcelable { if (group != null && group.getVideos() != null) { for (Video video : group.getVideos()) { - if (Helpers.equals(video.extractAuthor(), author)) { + if (Helpers.equals(video.getAuthor(), author)) { result.add(video); } } diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/managers/PlayerUIManager.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/managers/PlayerUIManager.java index 221dbb2a0..4346a6237 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/managers/PlayerUIManager.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/managers/PlayerUIManager.java @@ -352,7 +352,9 @@ public class PlayerUIManager extends PlayerEventListenerHelper implements Metada return; } - String description = getController().getVideo().description; + Video video = getController().getVideo(); + + String description = video.description; if (description == null || description.isEmpty()) { MessageHelpers.showMessage(getActivity(), R.string.description_not_found); @@ -363,7 +365,7 @@ public class PlayerUIManager extends PlayerEventListenerHelper implements Metada dialogPresenter.clear(); - String title = getController().getVideo().title; + String title = String.format("%s - %s", video.getTitle(), video.getAuthor()); dialogPresenter.appendLongTextCategory(title, UiOptionItem.from(description, null)); diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/dialogs/menu/BaseMenuPresenter.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/dialogs/menu/BaseMenuPresenter.java index 0a430d42c..027287d73 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/dialogs/menu/BaseMenuPresenter.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/dialogs/menu/BaseMenuPresenter.java @@ -124,8 +124,8 @@ public abstract class BaseMenuPresenter extends BasePresenter { // Trying to properly format channel playlists, mixes etc boolean isChannelPlaylistItem = video.getGroupTitle() != null && video.belongsToSameAuthorGroup() && video.belongsToSamePlaylistGroup(); boolean isUserPlaylistItem = video.getGroupTitle() != null && video.belongsToSamePlaylistGroup(); - String title = isChannelPlaylistItem ? video.extractAuthor() : isUserPlaylistItem ? null : video.title; - String subtitle = isChannelPlaylistItem || isUserPlaylistItem ? video.getGroupTitle() : video.extractAuthor(); + String title = isChannelPlaylistItem ? video.getAuthor() : isUserPlaylistItem ? null : video.title; + String subtitle = isChannelPlaylistItem || isUserPlaylistItem ? video.getGroupTitle() : video.getAuthor(); section.title = title != null && subtitle != null ? String.format("%s - %s", title, subtitle) : String.format("%s", title != null ? title : subtitle); section.cardImageUrl = video.cardImageUrl; @@ -144,8 +144,8 @@ public abstract class BaseMenuPresenter extends BasePresenter { // Trying to properly format channel playlists, mixes etc boolean hasChannel = video.hasChannel() && !video.isChannel(); boolean isUserPlaylistItem = video.getGroupTitle() != null && video.belongsToSamePlaylistGroup(); - String title = hasChannel ? video.extractAuthor() : isUserPlaylistItem ? null : video.title; - String subtitle = isUserPlaylistItem ? video.getGroupTitle() : hasChannel || video.isChannel() ? null : video.extractAuthor(); + String title = hasChannel ? video.getAuthor() : isUserPlaylistItem ? null : video.title; + String subtitle = isUserPlaylistItem ? video.getGroupTitle() : hasChannel || video.isChannel() ? null : video.getAuthor(); section.title = title != null && subtitle != null ? String.format("%s - %s", title, subtitle) : String.format("%s", title != null ? title : subtitle); section.cardImageUrl = video.cardImageUrl; diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/dialogs/menu/VideoMenuPresenter.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/dialogs/menu/VideoMenuPresenter.java index 3b7edbde3..dce175bf7 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/dialogs/menu/VideoMenuPresenter.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/dialogs/menu/VideoMenuPresenter.java @@ -581,7 +581,7 @@ public class VideoMenuPresenter extends BaseMenuPresenter { closeDialog(); MessageHelpers.showMessage(getContext(), String.format("%s: %s", - mVideo.extractAuthor(), + mVideo.getAuthor(), getContext().getString(containsVideo ? R.string.removed_from_playback_queue : R.string.added_to_playback_queue)) ); })); @@ -712,7 +712,7 @@ public class VideoMenuPresenter extends BaseMenuPresenter { } MessageHelpers.showMessage(getContext(), - video.extractAuthor() + ": " + getContext().getString(!video.isSubscribed ? R.string.unsubscribed_from_channel : R.string.subscribed_to_channel)); + video.getAuthor() + ": " + getContext().getString(!video.isSubscribed ? R.string.unsubscribed_from_channel : R.string.subscribed_to_channel)); } private void updateEnabledMenuItems() { diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/utils/AppDialogUtil.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/utils/AppDialogUtil.java index 6b319e697..7172aa0b1 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/utils/AppDialogUtil.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/utils/AppDialogUtil.java @@ -543,7 +543,7 @@ public class AppDialogUtil { for (Video video : playlist.getAll()) { String title = video.getTitle(); - String author = video.extractAuthor(); + String author = video.getAuthor(); options.add(0, UiOptionItem.from( // Add to start (recent videos on top) String.format("%s - %s", title != null ? title : "...", author != null ? author : "..."), optionItem -> { diff --git a/common/src/main/res/values/donations.xml b/common/src/main/res/values/donations.xml index 61adae538..4b0dc367e 100644 --- a/common/src/main/res/values/donations.xml +++ b/common/src/main/res/values/donations.xml @@ -1,12 +1,13 @@ - - + Patreon (Visa, Mastercard, PayPal)|https://www.patreon.com/smarttube + PayPal (email)|firsthash@gmail.com - PayPal (link)|https://www.paypal.com/donate/?business=2WLCM95RRVWZ6 - Patreon|https://www.patreon.com/smarttube + + + BTC|1JAT5VVWarVBkpVbNDn8UA8HXNdrukuBSx @@ -14,6 +15,8 @@ ETH|0xe455E21a085ae195a097cd4F456051A9916A5064 ETC|0x209eCd33Fa61fA92167595eB3Aea92EE1905c815 XMR|48QsMjqfkeW54vkgKyRnjodtYxdmLk6HXfTWPSZoaFPEDpoHDwFUciGCe1QC9VAeGrgGw4PKNAksX9RW7myFqYJQDN5cHGT + + \ No newline at end of file diff --git a/smarttubetv/src/main/java/com/liskovsoft/smartyoutubetv2/tv/adapter/VideoGroupObjectAdapter.java b/smarttubetv/src/main/java/com/liskovsoft/smartyoutubetv2/tv/adapter/VideoGroupObjectAdapter.java index 1900d679f..5e0dab3d1 100644 --- a/smarttubetv/src/main/java/com/liskovsoft/smartyoutubetv2/tv/adapter/VideoGroupObjectAdapter.java +++ b/smarttubetv/src/main/java/com/liskovsoft/smartyoutubetv2/tv/adapter/VideoGroupObjectAdapter.java @@ -145,8 +145,8 @@ public class VideoGroupObjectAdapter extends ObjectAdapter { } public void removeAuthor(VideoGroup group) { - String author = group.getVideos().get(0).extractAuthor(); // assume same author - List