Skip to content

Commit

Permalink
updatethread, store some prop
Browse files Browse the repository at this point in the history
  • Loading branch information
riderkick committed Jul 25, 2015
1 parent 48241e3 commit a08a661
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions baseunits/uUpdateThread.pas
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ TUpdateMangaManagerThread = class(TFMDThread)
directoryCount2, numberOfThreads, websitePtr: Integer;
threads: TFPList;
CS_threads: TCriticalSection;
SortedList, NoMangaInfo: Boolean;
constructor Create;
destructor Destroy; override;
procedure CheckCommit(const CommitCount: Integer = 32);
Expand Down Expand Up @@ -180,7 +181,7 @@ procedure TUpdateMangaThread.Execute;

//if website has sorted list by latest added
//we will stop at first found against current db
if SitesWithSortedList(manager.website) then
if manager.SortedList then
begin
if links.Count > 0 then
if manager.mainDataProcess.LinkExist(links.Strings[0]) then
Expand Down Expand Up @@ -327,6 +328,8 @@ constructor TUpdateMangaManagerThread.Create;
mainDataProcess := TDBDataProcess.Create;

threads := TFPList.Create;
SortedList := False;
NoMangaInfo := False;
end;

destructor TUpdateMangaManagerThread.Destroy;
Expand Down Expand Up @@ -576,6 +579,8 @@ procedure TUpdateMangaManagerThread.Execute;
while websitePtr < websites.Count do
begin
website := websites.Strings[websitePtr];
SortedList := SitesWithSortedList(website);
NoMangaInfo := SitesWithoutInformation(website);
Inc(websitePtr);
FStatus := RS_UpdatingList + Format(' [%d/%d] %s',
[websitePtr, websites.Count, website]) + ' | ' + RS_Preparing + '...';
Expand Down Expand Up @@ -716,7 +721,7 @@ procedure TUpdateMangaManagerThread.Execute;
begin
workPtr := 0;
FCommitCount := 0;
if (SitesWithoutInformation(website)) or
if NoMangaInfo or
OptionUpdateListNoMangaInfo then
begin
Inc(workPtr);
Expand Down Expand Up @@ -744,7 +749,7 @@ procedure TUpdateMangaManagerThread.Execute;
names.Clear;
links.Clear;

if (workPtr > 0) and (not SitesWithSortedList(website)) then
if (workPtr > 0) and (not SortedList) then
begin
FStatus := RS_UpdatingList + Format(' [%d/%d] %s',
[websitePtr, websites.Count, website]) + ' | ' + RS_SavingData + '...';
Expand Down

0 comments on commit a08a661

Please sign in to comment.