mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-16 14:25:02 -05:00
* set timestamp before xattr since timestamp should work even if xattr later throws an exception
This commit is contained in:
parent
1027aac904
commit
83f0dbe0dd
@ -1003,16 +1003,6 @@ public class MediaDetection {
|
|||||||
if ((model instanceof Episode || model instanceof Movie) && file.exists()) {
|
if ((model instanceof Episode || model instanceof Movie) && file.exists()) {
|
||||||
MetaAttributes xattr = new MetaAttributes(file);
|
MetaAttributes xattr = new MetaAttributes(file);
|
||||||
|
|
||||||
// store original name and model as xattr
|
|
||||||
try {
|
|
||||||
if (xattr.getOriginalName() == null) {
|
|
||||||
xattr.setOriginalName(file.getName());
|
|
||||||
}
|
|
||||||
xattr.setObject(model);
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.getLogger(MediaDetection.class.getClass().getName()).warning("Failed to set xattr: " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
// set creation date to episode / movie release date
|
// set creation date to episode / movie release date
|
||||||
try {
|
try {
|
||||||
if (model instanceof Episode) {
|
if (model instanceof Episode) {
|
||||||
@ -1029,6 +1019,17 @@ public class MediaDetection {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.getLogger(MediaDetection.class.getClass().getName()).warning("Failed to set creation date: " + e.getMessage());
|
Logger.getLogger(MediaDetection.class.getClass().getName()).warning("Failed to set creation date: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// store original name and model as xattr
|
||||||
|
try {
|
||||||
|
if (xattr.getOriginalName() == null) {
|
||||||
|
xattr.setOriginalName(file.getName());
|
||||||
|
}
|
||||||
|
xattr.setObject(model);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.getLogger(MediaDetection.class.getClass().getName()).warning("Failed to set xattr: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user