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
{
Result res = new Result();
res.setSource(name, abbr);
// Artist
if (resultArtistSelector != null)
res.setArtist(parser.getField(ele, resultArtistSelector));
res.setArtist(parser.getField(ele, resultArtistSelector).trim());
// Title
if (resultTitleSelector != null)
res.setTitle(parser.getField(ele, resultTitleSelector));
res.setTitle(parser.getField(ele, resultTitleSelector).trim());
// Link
if (resultLinkSelector != null)
res.setLink(parser.getURLField(ele, rootURL, resultLinkSelector));
// Artist + Album
if (resultAlbumArtistSelector != null)
res.setAlbumArtist(parser.getField(ele, resultAlbumArtistSelector));
res.setAlbumArtist(parser.getField(ele, resultAlbumArtistSelector).trim());
// Artist + Title

Loading…
Cancel
Save