* improved matching / mismatch highlighting
This commit is contained in:
parent
7a69d46f09
commit
c033fa565c
|
@ -43,10 +43,10 @@ public enum EpisodeMetrics implements SimilarityMetric {
|
|||
Episode episode = (Episode) object;
|
||||
|
||||
// get SxE from episode, both SxE for season/episode numbering and SxE for absolute episode numbering
|
||||
SxE seasonEpisode = new SxE(episode.getSeason(), episode.getEpisode());
|
||||
SxE absoluteEpisode = new SxE(null, episode.getAbsolute());
|
||||
SxE sxe = new SxE(episode.getSeason(), episode.getEpisode());
|
||||
SxE abs = new SxE(null, episode.getAbsolute());
|
||||
|
||||
result = seasonEpisode.equals(absoluteEpisode) ? singleton(absoluteEpisode) : asList(seasonEpisode, absoluteEpisode);
|
||||
result = (abs.episode < 0 || sxe.equals(abs)) ? singleton(sxe) : asList(sxe, abs);
|
||||
} else {
|
||||
result = super.parse(object);
|
||||
}
|
||||
|
|
|
@ -26,12 +26,12 @@ public class SeasonEpisodeMetric implements SimilarityMetric {
|
|||
float similarity = -1;
|
||||
for (SxE sxe1 : sxeVector1) {
|
||||
for (SxE sxe2 : sxeVector2) {
|
||||
if (sxe1.season >= 0 && sxe1.season == sxe2.season && sxe1.episode >= 0 && sxe1.episode == sxe2.episode) {
|
||||
if (sxe1.season == sxe2.season && sxe1.episode == sxe2.episode) {
|
||||
// vectors have at least one perfect episode match in common
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((sxe1.season >= 0 && sxe1.season == sxe2.season) || (sxe1.episode >= 0 && sxe1.episode == sxe2.episode)) {
|
||||
if (sxe1.season == sxe2.season || sxe1.episode == sxe2.episode) {
|
||||
// at least we have a partial match
|
||||
similarity = 0.5f;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ class RenameListCellRenderer extends DefaultFancyListCellRenderer {
|
|||
if (formattedFuture.isComplexFormat()) {
|
||||
typeRenderer.setVisible(true);
|
||||
typeRenderer.setAlpha(1.0f);
|
||||
typeRenderer.setText(formattedFuture.preview());
|
||||
typeRenderer.setText(formattedFuture.getMatch().getValue().toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue