feat: Custom Artwork Api
This commit is contained in:
parent
1b67eb76ef
commit
c611508c92
@ -31,6 +31,7 @@ import android.util.Base64;
|
||||
|
||||
import androidx.collection.LongSparseArray;
|
||||
|
||||
import xyz.nextalone.nagram.NaConfig;
|
||||
import xyz.nextalone.nagram.helper.MessageHelper;
|
||||
import xyz.nextalone.nagram.ui.syntaxhighlight.SyntaxHighlight;
|
||||
|
||||
@ -69,6 +70,7 @@ import java.util.Collections;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@ -6239,6 +6241,10 @@ public class MessageObject {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
String custom_api = NaConfig.INSTANCE.getCustomArtworkApi().String();
|
||||
if (!Objects.equals(custom_api, "")) {
|
||||
return custom_api + URLEncoder.encode(performer + " - " + title, "UTF-8");
|
||||
}
|
||||
return "athumb://itunes.apple.com/search?term=" + URLEncoder.encode(performer + " - " + title, "UTF-8") + "&entity=song&limit=4" + (small ? "&s=1" : "");
|
||||
} catch (Exception ignore) {
|
||||
|
||||
|
@ -96,6 +96,7 @@ public class NekoExperimentalSettingsActivity extends BaseFragment {
|
||||
private final AbstractConfigCell forceCopyRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getForceCopy()));
|
||||
private final AbstractConfigCell audioEnhanceRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getNoiseSuppressAndVoiceEnhance()));
|
||||
private final AbstractConfigCell showRPCErrorRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getShowRPCError()));
|
||||
private final AbstractConfigCell customArtworkApiRow = cellGroup.appendCell(new ConfigCellTextInput(null, NaConfig.INSTANCE.getCustomArtworkApi(), "", null));
|
||||
private final AbstractConfigCell divider1 = cellGroup.appendCell(new ConfigCellDivider());
|
||||
|
||||
private UndoView tooltip;
|
||||
|
@ -263,6 +263,11 @@ object NaConfig {
|
||||
ConfigItem.configTypeBool,
|
||||
false
|
||||
)
|
||||
val customArtworkApi = addConfig(
|
||||
"CustomArtworkApi",
|
||||
ConfigItem.configTypeString,
|
||||
""
|
||||
)
|
||||
|
||||
private fun addConfig(
|
||||
k: String,
|
||||
|
@ -60,4 +60,5 @@
|
||||
<string name="SendWithoutMarkdown">禁用 Markdown</string>
|
||||
<string name="SaveWithoutMarkdown">禁用 Markdown</string>
|
||||
<string name="SendAsEmoji">禁用小游戏</string>
|
||||
<string name="CustomArtworkApi">自定义音乐封面 API</string>
|
||||
</resources>
|
||||
|
@ -61,4 +61,5 @@
|
||||
<string name="SendWithoutMarkdown">Send without markdown</string>
|
||||
<string name="SaveWithoutMarkdown">Save without markdown</string>
|
||||
<string name="SendAsEmoji">Send as emoji</string>
|
||||
<string name="CustomArtworkApi">Custom Artwork Api</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user