Skip to content

Commit

Permalink
upgrade kisok uriIdhandler to ListUIHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
theScrabi committed Jul 8, 2018
1 parent 31b0480 commit 4746a1c
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.uih.ListUIHFactory;
import org.schabi.newpipe.extractor.uih.ListUIHandler;
import org.schabi.newpipe.extractor.uih.UIHFactory;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;

Expand All @@ -23,24 +25,24 @@ KioskExtractor createNewKiosk(final StreamingService streamingService,
private String defaultKiosk = null;

private class KioskEntry {
public KioskEntry(KioskExtractorFactory ef, UIHFactory h) {
public KioskEntry(KioskExtractorFactory ef, ListUIHFactory h) {
extractorFactory = ef;
handlerFactory = h;
}
final KioskExtractorFactory extractorFactory;
final UIHFactory handlerFactory;
final ListUIHFactory handlerFactory;
}

public KioskList(int service_id) {
this.service_id = service_id;
}

public void addKioskEntry(KioskExtractorFactory extractorFactory, UIHFactory handler, String id)
public void addKioskEntry(KioskExtractorFactory extractorFactory, ListUIHFactory handlerFactory, String id)
throws Exception {
if(kioskList.get(id) != null) {
throw new Exception("Kiosk with type " + id + " already exists.");
}
kioskList.put(id, new KioskEntry(extractorFactory, handler));
kioskList.put(id, new KioskEntry(extractorFactory, handlerFactory));
}

public void setDefaultKiosk(String kioskType) {
Expand Down Expand Up @@ -92,7 +94,7 @@ public KioskExtractor getExtractorByUrl(String url, String nextPageUrl)
throw new ExtractionException("Could not find a kiosk that fits to the url: " + url);
}

public UIHFactory getUIHFactoryByType(String type) {
public ListUIHFactory getUIHFactoryByType(String type) {
return kioskList.get(type).handlerFactory;
}
}

0 comments on commit 4746a1c

Please sign in to comment.