diff --git a/main/src/main/java/com/github/topi314/lavasrc/mirror/DefaultMirroringAudioTrackResolver.java b/main/src/main/java/com/github/topi314/lavasrc/mirror/DefaultMirroringAudioTrackResolver.java index 01fb7da4..9936bdae 100644 --- a/main/src/main/java/com/github/topi314/lavasrc/mirror/DefaultMirroringAudioTrackResolver.java +++ b/main/src/main/java/com/github/topi314/lavasrc/mirror/DefaultMirroringAudioTrackResolver.java @@ -45,7 +45,11 @@ public AudioItem apply(MirroringAudioTrack mirroringAudioTrack) { } } - provider = provider.replace(MirroringAudioSourceManager.QUERY_PATTERN, getTrackTitle(mirroringAudioTrack)); + if (provider.contains(MirroringAudioSourceManager.QUERY_TITLE_PATTERN)) { + provider = provider.replace(MirroringAudioSourceManager.QUERY_TITLE_PATTERN, getTitle(mirroringAudioTrack)); + } + + provider = provider.replace(MirroringAudioSourceManager.QUERY_PATTERN, getQuery(mirroringAudioTrack)); try { track = mirroringAudioTrack.loadItem(provider); } @@ -60,7 +64,7 @@ public AudioItem apply(MirroringAudioTrack mirroringAudioTrack) { return track; } - public String getTrackTitle(MirroringAudioTrack mirroringAudioTrack) { + public String getQuery(MirroringAudioTrack mirroringAudioTrack) { var query = mirroringAudioTrack.getInfo().title; if (!mirroringAudioTrack.getInfo().author.equals("unknown")) { query += " " + mirroringAudioTrack.getInfo().author; @@ -68,4 +72,9 @@ public String getTrackTitle(MirroringAudioTrack mirroringAudioTrack) { return query; } + public String getTitle(MirroringAudioTrack mirroringAudioTrack) { + var query = mirroringAudioTrack.getInfo().title; + return query; + } + } diff --git a/main/src/main/java/com/github/topi314/lavasrc/mirror/MirroringAudioSourceManager.java b/main/src/main/java/com/github/topi314/lavasrc/mirror/MirroringAudioSourceManager.java index bbbc83df..e2aa3447 100644 --- a/main/src/main/java/com/github/topi314/lavasrc/mirror/MirroringAudioSourceManager.java +++ b/main/src/main/java/com/github/topi314/lavasrc/mirror/MirroringAudioSourceManager.java @@ -19,6 +19,8 @@ public abstract class MirroringAudioSourceManager extends ExtendedAudioSourceMan public static final String ISRC_PATTERN = "%ISRC%"; public static final String QUERY_PATTERN = "%QUERY%"; + public static final String QUERY_TITLE_PATTERN = "%QUERY_TITLE%"; + private static final Logger log = LoggerFactory.getLogger(MirroringAudioSourceManager.class); protected final Function audioPlayerManager; protected final MirroringAudioTrackResolver resolver;