Webscraper: set source when returning results, and trim result fields.

master
Jim 3 years ago
parent b10f9d3573
commit eff1f5bfdc
  1. 7
      src/main/java/moe/nekojimi/musicsearcher/providers/WebScraperSearcher.java

@ -142,19 +142,20 @@ public class WebScraperSearcher extends Searcher
try try
{ {
Result res = new Result(); Result res = new Result();
res.setSource(name, abbr);
// Artist // Artist
if (resultArtistSelector != null) if (resultArtistSelector != null)
res.setArtist(parser.getField(ele, resultArtistSelector)); res.setArtist(parser.getField(ele, resultArtistSelector).trim());
// Title // Title
if (resultTitleSelector != null) if (resultTitleSelector != null)
res.setTitle(parser.getField(ele, resultTitleSelector)); res.setTitle(parser.getField(ele, resultTitleSelector).trim());
// Link // Link
if (resultLinkSelector != null) if (resultLinkSelector != null)
res.setLink(parser.getURLField(ele, rootURL, resultLinkSelector)); res.setLink(parser.getURLField(ele, rootURL, resultLinkSelector));
// Artist + Album // Artist + Album
if (resultAlbumArtistSelector != null) if (resultAlbumArtistSelector != null)
res.setAlbumArtist(parser.getField(ele, resultAlbumArtistSelector)); res.setAlbumArtist(parser.getField(ele, resultAlbumArtistSelector).trim());
// Artist + Title // Artist + Title

Loading…
Cancel
Save