/
JobAddAlbumJob.cs
71 lines (65 loc) · 2.31 KB
/
JobAddAlbumJob.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FlickrUploader
{
class JobAddAlbumJob : Job
{
public JobAddAlbumJob(DC context, string fullPath) : base(context, fullPath) { }
protected override void ExecuteOffThread() { }
protected override void ExecuteOnThread() { Context.AddCreateAlbumJobs(); }
protected override bool IsEqualOverride(object other) { return true; }
}
class NotUsedNowJobCreateTagList : Job
{
public NotUsedNowJobCreateTagList(DC context, DirectoryToUpload CurrentDirectory) : base(context, CurrentDirectory.DI.FullName)
{
m_CurrentDirectory = CurrentDirectory;
m_tagsforalbum = "";
}
protected override bool IsEqualOverride(object other) { return true; }
protected override void ExecuteOffThread()
{
bool first = true;
foreach (Photo P in m_CurrentDirectory.Photos)
{
{
var AL = from al in m_CurrentDirectory.Albums where al.Name == P.AlbumT select al;
Album A = null;
foreach (var a in AL)
{
A = a;
break;
}
if (A != null)
{
string ps = P.GetTags(A, Context.DSD.IgnoreWords);
if (ps != null && ps != "")
{
if (first)
{
first = false;
}
else
{
m_tagsforalbum += ",";
}
m_tagsforalbum += ps;
}
}
}
}
}
protected override void ExecuteOnThread()
{
if (m_tagsforalbum != null)
{
Context.DSD.AddTags(m_tagsforalbum);
Context.Log = "Count of words = " + Context.DSD.TagWords.Count().ToString() + "\r\n" + Context.Log;
}
}
private DirectoryToUpload m_CurrentDirectory;
private string m_tagsforalbum;
}
}