Last active
October 18, 2017 14:35
-
-
Save felixexter/97ddb80782c42ba433b2 to your computer and use it in GitHub Desktop.
Revisions
-
felixexter revised this gist
Jun 6, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ function deleteFiles(types = 'all') { let files = []; function deleteFilesByTypes(types, page = 1) { TS.api.call('files.list', { types, user: boot_data.user_id, page }, (a, data) => { files = [...files, ...data.files]; -
felixexter revised this gist
Jun 6, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ function deleteFiles(types = 'all') { function deleteFilesByTypes(types, page) { TS.api.call('files.list', { types, user: boot_data.user_id, page: page || 1 }, (a, data) => { -
felixexter revised this gist
Jun 6, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,4 +27,4 @@ function deleteFiles(types = 'all') { }; deleteFiles(); -
felixexter revised this gist
Jun 6, 2016 . 1 changed file with 27 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,25 +1,30 @@ function deleteFiles(types = 'all') { let files = []; function deleteFilesByTypes(types, page) { TS.api.call('files.list', { types: 'zips', user: boot_data.user_id, page: page || 1 }, (a, data) => { files = [...files, ...data.files]; if (data.paging.page !== Math.ceil(data.paging.total / data.paging.count)) { deleteFilesByTypes(types, data.paging.page + 1); } else { files.forEach(file => TS.api.call('files.delete', { file: file.id }, () => console.log('Файл удалён: ' + file.name) ) ); } }); }; deleteFilesByTypes(types); }; deleteFiles('zips'); -
felixexter created this gist
Jun 19, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ var files = []; function deleteFiles(page) { TS.api.call('files.list', { type: 'all', user: boot_data.user_id, page: page || 1 }, function(a, data) { files = [].concat.apply(files, data.files); if (data.paging.page !== Math.ceil(data.paging.total / data.paging.count)) { deleteFiles(data.paging.page + 1); } else { files.forEach(function (file) { TS.api.call('files.delete', { file: file.id }, function () { console.log('Файл удалён: ' + file.name); }); }); } }); } deleteFiles();