* fix original name xattr
This commit is contained in:
parent
9ed32437cd
commit
94ceccf966
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue