MCPcopy
hub / github.com/persepolisdm/persepolis / removeSelected2

Method removeSelected2

persepolis/scripts/mainwindow.py:2898–3016  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2896 self.removeSelected2()
2897
2898 def removeSelected2(self):
2899
2900 # find selected rows!
2901 gid_list = []
2902 for row in self.userSelectedRows():
2903 # get download status
2904 status = self.download_table.item(row, 1).text()
2905
2906 # find category
2907 category = self.download_table.item(row, 12).text()
2908
2909 if category != "Single Downloads":
2910 # check queue condition!
2911 # queue must be stopped first
2912 if str(category) in self.queue_list_dict.keys():
2913 queue_status = self.queue_list_dict[str(category)].start
2914 else:
2915 queue_status = False
2916
2917 if queue_status: # if queue was started
2918 # show error message
2919 notifySend(QCoreApplication.translate("mainwindow_src_ui_tr", "Operation was not successful!"),
2920 QCoreApplication.translate(
2921 "mainwindow_src_ui_tr", "Operation was not successful! Please stop the following category first: ") + category,
2922 5000, 'fail', parent=self)
2923
2924 continue
2925
2926 # find gid
2927 gid = self.download_table.item(row, 8).text()
2928
2929 # check if this link is related to video finder
2930 video_finder_link = False
2931 if gid in self.all_video_finder_gid_list:
2932
2933 video_finder_dictionary = self.persepolis_db.searchGidInVideoFinderTable(gid)
2934
2935 video_finder_link = True
2936 if gid in self.video_finder_threads_dict.keys():
2937 # check the Video Finder tread status
2938 video_finder_thread = self.video_finder_threads_dict[video_finder_dictionary['video_gid']]
2939
2940 if video_finder_thread.active == 'yes':
2941
2942 notifySend(QCoreApplication.translate("mainwindow_src_ui_tr", "Download is in progress by video finder!"),
2943 QCoreApplication.translate("mainwindow_src_ui_tr", "be patient!"),
2944 10000, 'warning', parent=self)
2945
2946 continue
2947
2948 # if Video Finder thread is not active so remove both of video and audio link.
2949 else:
2950 gid_list.append(video_finder_dictionary['video_gid'])
2951 gid_list.append(video_finder_dictionary['audio_gid'])
2952
2953 continue
2954
2955 # if Video Finder thread is not active so remove both of video and audio link.

Callers 1

removeSelectedMethod · 0.95

Calls 6

userSelectedRowsMethod · 0.95
notifySendFunction · 0.90
startMethod · 0.45

Tested by

no test coverage detected