mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Improved debug logging
This commit is contained in:
parent
431966cbbd
commit
1a6994c491
@ -87,6 +87,10 @@ public class EpisodeMetrics {
|
|||||||
return sxe;
|
return sxe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SeasonEpisode";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match episode airdate
|
// Match episode airdate
|
||||||
@ -110,6 +114,10 @@ public class EpisodeMetrics {
|
|||||||
}).orElse(null);
|
}).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AirDate";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match by episode/movie title
|
// Match by episode/movie title
|
||||||
@ -137,6 +145,10 @@ public class EpisodeMetrics {
|
|||||||
return s.length() >= 4 ? s : null; // only consider long enough strings to avoid false matches
|
return s.length() >= 4 ? s : null; // only consider long enough strings to avoid false matches
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Title";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match by SxE and airdate
|
// Match by SxE and airdate
|
||||||
@ -176,6 +188,10 @@ public class EpisodeMetrics {
|
|||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "EpisodeBalancer";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match series title and episode title against folder structure and file name
|
// Match series title and episode title against folder structure and file name
|
||||||
@ -236,6 +252,10 @@ public class EpisodeMetrics {
|
|||||||
return new Object[] { object };
|
return new Object[] { object };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SubstringFields";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match via common word sequence in episode name and file name
|
// Match via common word sequence in episode name and file name
|
||||||
@ -285,6 +305,10 @@ public class EpisodeMetrics {
|
|||||||
return singletonList(object);
|
return singletonList(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "NameSubstringSequence";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match by generic name similarity (round rank)
|
// Match by generic name similarity (round rank)
|
||||||
@ -303,6 +327,10 @@ public class EpisodeMetrics {
|
|||||||
return normalizeObject(object);
|
return normalizeObject(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Name";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match by generic name similarity (absolute)
|
// Match by generic name similarity (absolute)
|
||||||
@ -357,6 +385,10 @@ public class EpisodeMetrics {
|
|||||||
return emptyList();
|
return emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SeriesName";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public final SimilarityMetric SeriesNameBalancer = new MetricCascade(NameSubstringSequence, Name, SeriesName);
|
public final SimilarityMetric SeriesNameBalancer = new MetricCascade(NameSubstringSequence, Name, SeriesName);
|
||||||
@ -372,6 +404,10 @@ public class EpisodeMetrics {
|
|||||||
return normalizeObject(object.toString()); // simplify file name, if possible
|
return normalizeObject(object.toString()); // simplify file name, if possible
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "FilePath";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public final SimilarityMetric FilePathBalancer = new NameSimilarityMetric() {
|
public final SimilarityMetric FilePathBalancer = new NameSimilarityMetric() {
|
||||||
@ -396,6 +432,10 @@ public class EpisodeMetrics {
|
|||||||
return object.toString();
|
return object.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "FilePathBalancer";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public final SimilarityMetric NumericSequence = new SequenceMatchSimilarity() {
|
public final SimilarityMetric NumericSequence = new SequenceMatchSimilarity() {
|
||||||
@ -435,6 +475,10 @@ public class EpisodeMetrics {
|
|||||||
return join(numbers, " ");
|
return join(numbers, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "NumericSequence";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match by generic numeric similarity
|
// Match by generic numeric similarity
|
||||||
@ -478,6 +522,10 @@ public class EpisodeMetrics {
|
|||||||
return new String[] { normalizeObject(object) };
|
return new String[] { normalizeObject(object) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Numeric";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Prioritize proper episodes over specials
|
// Prioritize proper episodes over specials
|
||||||
@ -496,6 +544,10 @@ public class EpisodeMetrics {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SpecialNumber";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match by file length (only works when matching torrents or files)
|
// Match by file length (only works when matching torrents or files)
|
||||||
@ -515,6 +567,10 @@ public class EpisodeMetrics {
|
|||||||
return super.getLength(object);
|
return super.getLength(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "FileSize";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match by common words at the beginning of both files
|
// Match by common words at the beginning of both files
|
||||||
@ -528,6 +584,10 @@ public class EpisodeMetrics {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "FileName";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match by file last modified and episode release dates
|
// Match by file last modified and episode release dates
|
||||||
@ -584,6 +644,11 @@ public class EpisodeMetrics {
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TimeStamp";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public final SimilarityMetric SeriesRating = new SimilarityMetric() {
|
public final SimilarityMetric SeriesRating = new SimilarityMetric() {
|
||||||
@ -614,6 +679,11 @@ public class EpisodeMetrics {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SeriesRating";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public final SimilarityMetric VoteRate = new SimilarityMetric() {
|
public final SimilarityMetric VoteRate = new SimilarityMetric() {
|
||||||
@ -638,6 +708,11 @@ public class EpisodeMetrics {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "VoteRate";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match by (region) or (year) hints
|
// Match by (region) or (year) hints
|
||||||
@ -681,6 +756,11 @@ public class EpisodeMetrics {
|
|||||||
|
|
||||||
return emptySet();
|
return emptySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "RegionHint";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Match by stored MetaAttributes if possible
|
// Match by stored MetaAttributes if possible
|
||||||
@ -705,6 +785,10 @@ public class EpisodeMetrics {
|
|||||||
return emptyMap();
|
return emptyMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MetaAttributes";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected final Map<Object, String> transformCache = synchronizedMap(new HashMap<>(64, 4));
|
protected final Map<Object, String> transformCache = synchronizedMap(new HashMap<>(64, 4));
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.filebot.similarity;
|
package net.filebot.similarity;
|
||||||
|
|
||||||
import static java.util.Arrays.*;
|
import static java.util.Arrays.*;
|
||||||
|
import static java.util.stream.Collectors.*;
|
||||||
|
|
||||||
public class MetricCascade implements SimilarityMetric {
|
public class MetricCascade implements SimilarityMetric {
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ public class MetricCascade implements SimilarityMetric {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return getClass().getSimpleName() + ' ' + asList(cascade);
|
return stream(cascade).map(Object::toString).collect(joining(", ", "MetricCascade (", ")"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,10 @@ public class SubtitleMetrics extends EpisodeMetrics {
|
|||||||
return f < 1 ? -1 : 1;
|
return f < 1 ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AbsoluteSeasonEpisode";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public final SimilarityMetric DiskNumber = new NumericSimilarityMetric() {
|
public final SimilarityMetric DiskNumber = new NumericSimilarityMetric() {
|
||||||
@ -66,6 +70,10 @@ public class SubtitleMetrics extends EpisodeMetrics {
|
|||||||
return cd;
|
return cd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "DiskNumber";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public final SimilarityMetric NameSubstringSequenceExists = new SequenceMatchSimilarity() {
|
public final SimilarityMetric NameSubstringSequenceExists = new SequenceMatchSimilarity() {
|
||||||
@ -116,6 +124,10 @@ public class SubtitleMetrics extends EpisodeMetrics {
|
|||||||
return emptyList();
|
return emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "NameSubstringSequenceExists";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public final SimilarityMetric OriginalFileName = new SequenceMatchSimilarity() {
|
public final SimilarityMetric OriginalFileName = new SequenceMatchSimilarity() {
|
||||||
@ -141,6 +153,10 @@ public class SubtitleMetrics extends EpisodeMetrics {
|
|||||||
return super.normalize(object);
|
return super.normalize(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "OriginalFileName";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public final SimilarityMetric VideoProperties = new CrossPropertyMetric() {
|
public final SimilarityMetric VideoProperties = new CrossPropertyMetric() {
|
||||||
@ -195,6 +211,11 @@ public class SubtitleMetrics extends EpisodeMetrics {
|
|||||||
return emptyMap();
|
return emptyMap();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "VideoProperties";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user