* fix original name xattr

This commit is contained in:
Reinhard Pointner 2014-01-08 20:52:28 +00:00
parent 9ed32437cd
commit 94ceccf966
3 changed files with 5 additions and 5 deletions

View File

@ -614,7 +614,7 @@ public class CmdlineOperations implements CmdlineInterface {
if (renameMap.containsKey(file) && meta != null) {
File destination = resolveDestination(file, renameMap.get(file), false);
if (destination.isFile()) {
MediaDetection.storeMetaInfo(destination, meta);
MediaDetection.storeMetaInfo(destination, meta, file.getName());
}
}
}

View File

@ -1249,7 +1249,7 @@ public class MediaDetection {
}
}
public static void storeMetaInfo(File file, Object model) {
public static void storeMetaInfo(File file, Object model, String original) {
// only for Episode / Movie objects
if ((model instanceof Episode || model instanceof Movie) && file.exists()) {
try {
@ -1275,8 +1275,8 @@ public class MediaDetection {
// store original name and model as xattr
try {
xattr.setObject(model);
if (xattr.getOriginalName() == null) {
xattr.setOriginalName(file.getName());
if (xattr.getOriginalName() == null && original != null) {
xattr.setOriginalName(original);
}
} catch (Exception e) {
Logger.getLogger(MediaDetection.class.getClass().getName()).warning("Failed to set xattr: " + e.getMessage());

View File

@ -123,7 +123,7 @@ class RenameAction extends AbstractAction {
if (renameMap.containsKey(file) && meta != null) {
File destination = resolveDestination(file, renameMap.get(file), false);
if (destination.isFile()) {
MediaDetection.storeMetaInfo(destination, meta);
MediaDetection.storeMetaInfo(destination, meta, file.getName());
}
}
}