mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 16:58:51 -05:00
* fix some GUI movie auto-selection issues
This commit is contained in:
parent
54d4dad955
commit
c981cba2e2
@ -151,8 +151,8 @@ movies = tmdb.findResults{
|
|||||||
movies = treeSort(movies, { it[3, 2].join(' ') })
|
movies = treeSort(movies, { it[3, 2].join(' ') })
|
||||||
|
|
||||||
// sanity check
|
// sanity check
|
||||||
pack(moviedb_out, movies*.join('\t'))
|
|
||||||
if (movies.size() < 50000) { throw new Exception('Movie index sanity failed') }
|
if (movies.size() < 50000) { throw new Exception('Movie index sanity failed') }
|
||||||
|
pack(moviedb_out, movies*.join('\t'))
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
@ -243,8 +243,8 @@ thetvdb_index = thetvdb_index.sort({ a, b -> a[0] <=> b[0] } as Comparator)
|
|||||||
def thetvdb_txt = thetvdb_index.groupBy{ it[0] }.findResults{ k, v -> ([k.pad(6)] + v*.getAt(1).unique{ it.toLowerCase() }).join('\t') }
|
def thetvdb_txt = thetvdb_index.groupBy{ it[0] }.findResults{ k, v -> ([k.pad(6)] + v*.getAt(1).unique{ it.toLowerCase() }).join('\t') }
|
||||||
|
|
||||||
// sanity check
|
// sanity check
|
||||||
pack(thetvdb_out, thetvdb_txt)
|
|
||||||
if (thetvdb_txt.size() < 30000) { throw new Exception('TheTVDB index sanity failed') }
|
if (thetvdb_txt.size() < 30000) { throw new Exception('TheTVDB index sanity failed') }
|
||||||
|
pack(thetvdb_out, thetvdb_txt)
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
@ -265,5 +265,5 @@ def anidb_index = anidb.findResults{
|
|||||||
def anidb_txt = anidb_index.findResults{ row -> row.join('\t') }.sort().unique()
|
def anidb_txt = anidb_index.findResults{ row -> row.join('\t') }.sort().unique()
|
||||||
|
|
||||||
// sanity check
|
// sanity check
|
||||||
pack(anidb_out, anidb_txt)
|
|
||||||
if (anidb_txt.size() < 8000) { throw new Exception('AniDB index sanity failed') }
|
if (anidb_txt.size() < 8000) { throw new Exception('AniDB index sanity failed') }
|
||||||
|
pack(anidb_out, anidb_txt)
|
||||||
|
@ -207,7 +207,8 @@ def getRenameLog(complete = false) {
|
|||||||
import net.sourceforge.filebot.similarity.*
|
import net.sourceforge.filebot.similarity.*
|
||||||
|
|
||||||
def stripReleaseInfo(name, strict = true) {
|
def stripReleaseInfo(name, strict = true) {
|
||||||
return MediaDetection.stripReleaseInfo([name], strict)[0]
|
def result = MediaDetection.stripReleaseInfo([name], strict)
|
||||||
|
return result.size() > 0 ? result[0] : null
|
||||||
}
|
}
|
||||||
|
|
||||||
def isEpisode(path, strict = true) {
|
def isEpisode(path, strict = true) {
|
||||||
|
@ -335,10 +335,20 @@ class MovieHashMatcher implements AutoCompleteMatcher {
|
|||||||
final List<Movie> probableMatches = new LinkedList<Movie>();
|
final List<Movie> probableMatches = new LinkedList<Movie>();
|
||||||
|
|
||||||
final SimilarityMetric metric = new NameSimilarityMetric();
|
final SimilarityMetric metric = new NameSimilarityMetric();
|
||||||
|
final float threshold = 0.9f;
|
||||||
|
|
||||||
// find probable matches using name similarity >= 0.9
|
// find probable matches using name similarity >= 0.9
|
||||||
for (Movie result : options) {
|
for (Movie result : options) {
|
||||||
if (metric.getSimilarity(fileQuery, result.getName()) >= 0.9 || metric.getSimilarity(folderQuery, result.getName()) >= 0.9) {
|
float maxSimilarity = 0;
|
||||||
|
for (String query : new String[] { fileQuery, folderQuery }) {
|
||||||
|
for (String name : result.getEffectiveNamesWithoutYear()) {
|
||||||
|
if (maxSimilarity >= threshold)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
maxSimilarity = Math.max(maxSimilarity, metric.getSimilarity(query, name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (maxSimilarity >= threshold) {
|
||||||
probableMatches.add(result);
|
probableMatches.add(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user