@ -12,6 +12,7 @@ import shutil
import subprocess
import subprocess
from home . src . download . thumbnails import ThumbManager
from home . src . download . thumbnails import ThumbManager
from home . src . index . comments import CommentList
from home . src . index . video import YoutubeVideo
from home . src . index . video import YoutubeVideo
from home . src . ta . config import AppConfig
from home . src . ta . config import AppConfig
from home . src . ta . helper import ignore_filelist
from home . src . ta . helper import ignore_filelist
@ -141,6 +142,9 @@ class ImportFolderScanner:
ManualImport ( current_video , self . CONFIG ) . run ( )
ManualImport ( current_video , self . CONFIG ) . run ( )
video_ids = [ i [ " video_id " ] for i in self . to_import ]
CommentList ( video_ids , task = self . task ) . index ( )
def _notify ( self , idx , current_video ) :
def _notify ( self , idx , current_video ) :
""" send notification back to task """
""" send notification back to task """
filename = os . path . split ( current_video [ " media " ] ) [ - 1 ]
filename = os . path . split ( current_video [ " media " ] ) [ - 1 ]
@ -427,15 +431,22 @@ class ManualImport:
def _move_to_archive ( self , json_data ) :
def _move_to_archive ( self , json_data ) :
""" move identified media file to archive """
""" move identified media file to archive """
videos = self . config [ " application " ] [ " videos " ]
videos = self . config [ " application " ] [ " videos " ]
host_uid = self . config [ " application " ] [ " HOST_UID " ]
host_gid = self . config [ " application " ] [ " HOST_GID " ]
channel , file = os . path . split ( json_data [ " media_url " ] )
channel , file = os . path . split ( json_data [ " media_url " ] )
channel_folder = os . path . join ( videos , channel )
channel_folder = os . path . join ( videos , channel )
if not os . path . exists ( channel_folder ) :
if not os . path . exists ( channel_folder ) :
os . makedirs ( channel_folder )
os . makedirs ( channel_folder )
if host_uid and host_gid :
os . chown ( channel_folder , host_uid , host_gid )
old_path = self . current_video [ " media " ]
old_path = self . current_video [ " media " ]
new_path = os . path . join ( channel_folder , file )
new_path = os . path . join ( channel_folder , file )
shutil . move ( old_path , new_path , copy_function = shutil . copyfile )
shutil . move ( old_path , new_path , copy_function = shutil . copyfile )
if host_uid and host_gid :
os . chown ( new_path , host_uid , host_gid )
base_name , _ = os . path . splitext ( new_path )
base_name , _ = os . path . splitext ( new_path )
for old_path in self . current_video [ " subtitle " ] :
for old_path in self . current_video [ " subtitle " ] :