* check for series .nfo 2 folder levels deep
* update artwork.* scripts and generate tvdb links in series .nfo for future lookup
This commit is contained in:
parent
441f2fd2cf
commit
7cf2177f79
|
@ -32,6 +32,7 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
@ -870,8 +871,16 @@ public class MediaDetection {
|
|||
public static Set<SearchResult> lookupSeriesNameByInfoFile(Collection<File> files, Locale language) throws Exception {
|
||||
Set<SearchResult> names = new LinkedHashSet<SearchResult>();
|
||||
|
||||
SortedSet<File> folders = new TreeSet<File>(reverseOrder());
|
||||
for (File f : files) {
|
||||
for (int i = 0; i < 2 && f.getParentFile() != null; i++) {
|
||||
f = f.getParentFile();
|
||||
folders.add(f);
|
||||
}
|
||||
}
|
||||
|
||||
// search for id in sibling nfo files
|
||||
for (File folder : mapByFolder(files).keySet()) {
|
||||
for (File folder : folders) {
|
||||
if (!folder.exists())
|
||||
continue;
|
||||
|
||||
|
|
|
@ -164,6 +164,7 @@ LIMITED
|
|||
LMAO
|
||||
lol
|
||||
Los.Sustitutos
|
||||
M.HD
|
||||
mkvonly
|
||||
mpg$
|
||||
MultiSub
|
||||
|
|
|
@ -875,6 +875,7 @@ LeON
|
|||
LEVERAGE
|
||||
LEViTY
|
||||
LGLuX
|
||||
LiFE
|
||||
lilwoodenboy
|
||||
LiMiTED
|
||||
LiNE
|
||||
|
|
|
@ -4,4 +4,5 @@ Hml8p Homeland
|
|||
hoc House of Cards
|
||||
M.A.S.H M*A*S*H
|
||||
MASH M*A*S*H
|
||||
NCIS.LA NCIS: Los Angeles
|
||||
NCIS.LA NCIS: Los Angeles
|
||||
tvs.got Game of Thrones
|
|
@ -1,4 +1,5 @@
|
|||
// filebot -script fn:artwork.tmdb /path/to/movies/
|
||||
def override = _args.conflict == 'override'
|
||||
|
||||
/*
|
||||
* Fetch movie artwork. The movie is determined using the parent folders name.
|
||||
|
@ -10,7 +11,7 @@ include('lib/htpc')
|
|||
|
||||
args.eachMediaFolder{ dir ->
|
||||
// fetch only missing artwork by default
|
||||
if (_args.conflict == 'skip' && dir.hasFile{it.name == 'movie.nfo'} && dir.hasFile{it.name == 'poster.jpg'} && dir.hasFile{it.name == 'fanart.jpg'}) {
|
||||
if (!override && dir.hasFile{it.name == 'movie.nfo'} && dir.hasFile{it.name == 'poster.jpg'} && dir.hasFile{it.name == 'fanart.jpg'}) {
|
||||
println "Skipping $dir"
|
||||
return
|
||||
}
|
||||
|
@ -45,7 +46,7 @@ args.eachMediaFolder{ dir ->
|
|||
|
||||
println "$dir => $movie"
|
||||
try {
|
||||
fetchMovieArtworkAndNfo(dir, movie, dir.getFiles{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }, true, true)
|
||||
fetchMovieArtworkAndNfo(dir, movie, dir.getFiles{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }, true, override)
|
||||
} catch(e) {
|
||||
println "${e.class.simpleName}: ${e.message}"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// filebot -script fn:artwork.tvdb /path/to/media/
|
||||
def override = _args.conflict == 'override'
|
||||
|
||||
/*
|
||||
* Fetch series and season banners for all tv shows. Series name is auto-detected if possible or the folder name is used.
|
||||
|
@ -10,7 +11,7 @@ include('lib/htpc')
|
|||
|
||||
args.eachMediaFolder{ dir ->
|
||||
// fetch only missing artwork by default
|
||||
if (_args.conflict == 'skip' && [dir, dir.dir].find{ it.hasFile{it.name == 'banner.jpg'} }) {
|
||||
if (!override && dir.hasFile{it.name == 'banner.jpg'}) {
|
||||
println "Skipping $dir"
|
||||
return
|
||||
}
|
||||
|
@ -47,5 +48,5 @@ args.eachMediaFolder{ dir ->
|
|||
def season = sxe && sxe.season > 0 ? sxe.season : 1
|
||||
|
||||
println "$dir => $series"
|
||||
fetchSeriesArtworkAndNfo(seriesDir, dir, series, season, true)
|
||||
fetchSeriesArtworkAndNfo(seriesDir, dir, series, season, override)
|
||||
}
|
||||
|
|
|
@ -98,6 +98,7 @@ def fetchSeriesNfo(outputFile, seriesInfo, override, locale) {
|
|||
name(n)
|
||||
}
|
||||
}
|
||||
tvdb(id:i.id, "http://www.thetvdb.com/?tab=series&id=${i.id}")
|
||||
}
|
||||
}
|
||||
.saveAs(outputFile)
|
||||
|
|
Loading…
Reference in New Issue