optimize logs, users/related always refresh

This commit is contained in:
2020-05-21 08:43:34 +08:00
parent 21c93310ea
commit 5b8e02a04b
18 changed files with 164 additions and 116 deletions

View File

@@ -280,7 +280,7 @@ namespace Pixiview.Illust
if (bookmarkId != null)
{
// not exists in remote any more
#if DEBUG
#if LOG
App.DebugPrint($"remove bookmark ({bookmarkId}) - {b.Id}: {b.Title}");
#endif
nows.RemoveAt(i);
@@ -289,7 +289,7 @@ namespace Pixiview.Illust
else if (bookmarkId != bookmark.BookmarkId)
{
// update bookmark id
#if DEBUG
#if LOG
App.DebugPrint($"change bookmark ({bookmarkId}) to ({bookmark.BookmarkId}) - {b.Id}: {b.Title}");
#endif
b.BookmarkId = bookmark.BookmarkId;
@@ -303,7 +303,7 @@ namespace Pixiview.Illust
for (var i = 0; i < list.Length; i++)
{
var item = list[i];
#if DEBUG
#if LOG
App.DebugPrint($"add bookmark ({item.BookmarkId}) - {item.Id}: {item.Title}");
#endif
item.Image = StyleDefinition.DownloadBackground;
@@ -316,7 +316,7 @@ namespace Pixiview.Illust
return;
}
ParallelTask.Start(0, list.Length, Configs.MaxPageThreads, i =>
ParallelTask.Start("favorite.loadimages", 0, list.Length, Configs.MaxPageThreads, i =>
{
var illustItem = list[i];
var data = Stores.LoadIllustPreloadData(illustItem.Id);

View File

@@ -595,7 +595,7 @@ namespace Pixiview.Illust
task.Dispose();
task = null;
}
task = ParallelTask.Start(0, collection.Count, Configs.MaxThreads, i =>
task = ParallelTask.Start("collection.load", 0, collection.Count, Configs.MaxThreads, i =>
{
if (!collection.Running)
{

View File

@@ -45,7 +45,7 @@ namespace Pixiview.Illust
if (startIndex < 0)
{
// init
data = Stores.LoadIllustRecommendsInitData(illustItem.Id, force);
data = Stores.LoadIllustRecommendsInitData(illustItem.Id);
if (data == null || data.body == null)
{
return null;

View File

@@ -400,7 +400,7 @@ namespace Pixiview.Illust
task.Dispose();
task = null;
}
task = ParallelTask.Start(0, items.Length, Configs.MaxPageThreads, i =>
task = ParallelTask.Start("view.illusts", 0, items.Length, Configs.MaxPageThreads, i =>
{
DoLoadImage(i);
return true;
@@ -545,6 +545,10 @@ namespace Pixiview.Illust
{
return;
}
if (Configs.Cookie == null)
{
return;
}
if (!add && string.IsNullOrEmpty(bookmarkId))
{
return;