@Test public void testGetTVGaps() throws Exception { List<MediaFile> files = new ArrayList<>(); files.add(newMediaFile("Series1", 1, 1)); files.add(newMediaFile("Series1", 1, 2)); files.add(newMediaFile("Series1", 1, 5)); files.add(newMediaFile("Series1", 1, 6)); files.add(newMediaFile("Series1", 1, 8)); files.add(newMediaFile("Series1", 2, 2)); files.add(newMediaFile("Series1", 2, 4)); files.add(newMediaFile("Series2", 1, 4)); files.add(newMediaFile("Series2", 1, 5)); files.add(newMediaFile("Series2", 1, 7)); files.add(newMediaFile("Series2", 2, 1)); files.add(newMediaFile("Series2", 2, 4)); files.add(newMediaFile("Series2", 3, 1)); files.add(newMediaFile("Series2", 3, 3)); Map<String, List<Pair<Integer>>> gaps = getTVGaps(files); dump(gaps); verify(gaps.get("Series1"), new Pair(1, 3), new Pair(1, 4), new Pair(1, 7), new Pair(2, 3)); verify(gaps.get("Series2"), new Pair(1, 6), new Pair(2, 2), new Pair(2,3), new Pair(3,2)); }
public static Map<String, List<Pair<Integer>>> getTVGaps(Future<H2PersistenceManager> dao) throws Exception { String allShowsQuery = "mediatype='tv' order by title, season, episode"; Collection<MediaFile> files = dao.get().getMediaFileDAO().query(allShowsQuery); return getTVGaps(files); }
TVGapsUtil { public static Map<String, List<Pair<Integer>>> getTVGaps(Future<H2PersistenceManager> dao) throws Exception { String allShowsQuery = "mediatype='tv' order by title, season, episode"; Collection<MediaFile> files = dao.get().getMediaFileDAO().query(allShowsQuery); return getTVGaps(files); } }
TVGapsUtil { public static Map<String, List<Pair<Integer>>> getTVGaps(Future<H2PersistenceManager> dao) throws Exception { String allShowsQuery = "mediatype='tv' order by title, season, episode"; Collection<MediaFile> files = dao.get().getMediaFileDAO().query(allShowsQuery); return getTVGaps(files); }  }
TVGapsUtil { public static Map<String, List<Pair<Integer>>> getTVGaps(Future<H2PersistenceManager> dao) throws Exception { String allShowsQuery = "mediatype='tv' order by title, season, episode"; Collection<MediaFile> files = dao.get().getMediaFileDAO().query(allShowsQuery); return getTVGaps(files); }  static Collection<MediaFile> getTVGapFiles(Future<H2PersistenceManager> dao); static Observable<Collection<MediaFile>> getTVGapFilesObserable(final Future<H2PersistenceManager> dao); static Map<String, List<Pair<Integer>>> getTVGaps(Future<H2PersistenceManager> dao); static Map<String, List<Pair<Integer>>> getTVGaps(Collection<MediaFile> files); }
TVGapsUtil { public static Map<String, List<Pair<Integer>>> getTVGaps(Future<H2PersistenceManager> dao) throws Exception { String allShowsQuery = "mediatype='tv' order by title, season, episode"; Collection<MediaFile> files = dao.get().getMediaFileDAO().query(allShowsQuery); return getTVGaps(files); }  static Collection<MediaFile> getTVGapFiles(Future<H2PersistenceManager> dao); static Observable<Collection<MediaFile>> getTVGapFilesObserable(final Future<H2PersistenceManager> dao); static Map<String, List<Pair<Integer>>> getTVGaps(Future<H2PersistenceManager> dao); static Map<String, List<Pair<Integer>>> getTVGaps(Collection<MediaFile> files);  }