mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
cc2c794ad0
commit
a066e217a6
11 changed files with 62 additions and 39 deletions
|
@ -16,12 +16,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.2.2",
|
||||
"_release": "1.2.2",
|
||||
"version": "1.2.4",
|
||||
"_release": "1.2.4",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.2.2",
|
||||
"commit": "090c43863857847e33055ba1d7ab278b17f76203"
|
||||
"tag": "1.2.4",
|
||||
"commit": "f948300fd2b45386448971b7b212635b575887c5"
|
||||
},
|
||||
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.0",
|
||||
|
|
|
@ -98,25 +98,48 @@ define(['cryptojs-md5'], function () {
|
|||
|
||||
fileEntry.file(function (file) {
|
||||
|
||||
var lastModifiedDate = file.lastModifiedDate;
|
||||
if (!lastModifiedDate) {
|
||||
lastModifiedDate = fileEntry.getMetadata().lastModifiedDate;
|
||||
getLastModified(file, fileEntry).then(function (lastModifiedDate) {
|
||||
|
||||
var elapsed = new Date().getTime() - lastModifiedDate;
|
||||
// 40 days
|
||||
var maxElapsed = 3456000000;
|
||||
if (elapsed >= maxElapsed) {
|
||||
|
||||
var fullPath = fileEntry.fullPath;
|
||||
console.log('deleting file: ' + fullPath);
|
||||
|
||||
fileEntry.remove(function () {
|
||||
console.log('File deleted: ' + fullPath);
|
||||
}, function () {
|
||||
console.log('Failed to delete file: ' + fullPath);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function getLastModified(file, fileEntry) {
|
||||
|
||||
var lastModifiedDate = file.lastModified || file.lastModifiedDate || file.modificationTime;
|
||||
if (lastModifiedDate) {
|
||||
if (lastModifiedDate.getTime) {
|
||||
lastModifiedDate = lastModifiedDate.getTime();
|
||||
}
|
||||
return Promise.resolve(lastModifiedDate);
|
||||
}
|
||||
|
||||
var elapsed = new Date().getTime() - lastModifiedDate.getTime();
|
||||
// 45 days
|
||||
var maxElapsed = 3888000000;
|
||||
if (elapsed >= maxElapsed) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var fullPath = fileEntry.fullPath;
|
||||
console.log('deleting file: ' + fullPath);
|
||||
|
||||
fileEntry.remove(function () {
|
||||
console.log('File deleted: ' + fullPath);
|
||||
}, function () {
|
||||
console.log('Failed to delete file: ' + fullPath);
|
||||
});
|
||||
}
|
||||
fileEntry.getMetadata(function (metadata) {
|
||||
var lastModifiedDate = metadata.lastModified || metadata.lastModifiedDate || metadata.modificationTime;
|
||||
if (lastModifiedDate) {
|
||||
if (lastModifiedDate.getTime) {
|
||||
lastModifiedDate = lastModifiedDate.getTime();
|
||||
}
|
||||
}
|
||||
resolve(lastModifiedDate);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue