отображения типа файла в списке файлов
This commit is contained in:
@ -274,7 +274,7 @@ const detectSubCategory = (torrent, files, typesPriority, contentType) => {
|
||||
}
|
||||
}
|
||||
|
||||
const fileDetect = (file) => {
|
||||
const fileTypeDetect = (file) => {
|
||||
let name = file.path.split('/').pop();
|
||||
let extension = name.split('.').pop();
|
||||
if(name.length == 0)
|
||||
@ -291,7 +291,7 @@ const torrentTypeDetect = (torrent, files) => {
|
||||
|
||||
for(let i = 0; i < files.length; i++) {
|
||||
let file = files[i];
|
||||
let type = fileDetect(file)
|
||||
let type = fileTypeDetect(file)
|
||||
|
||||
if(type) {
|
||||
if(!typesPriority[type])
|
||||
@ -309,4 +309,4 @@ const torrentTypeDetect = (torrent, files) => {
|
||||
detectSubCategory(torrent, files, typesPriority, torrent[ContentTypeProp]);
|
||||
}
|
||||
|
||||
module.exports = torrentTypeDetect;
|
||||
module.exports = {torrentTypeDetect, fileTypeDetect};
|
||||
|
Reference in New Issue
Block a user