aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Library/ml_wire/ChannelRefresher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Plugins/Library/ml_wire/ChannelRefresher.cpp')
-rw-r--r--Src/Plugins/Library/ml_wire/ChannelRefresher.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/Src/Plugins/Library/ml_wire/ChannelRefresher.cpp b/Src/Plugins/Library/ml_wire/ChannelRefresher.cpp
new file mode 100644
index 00000000..07539964
--- /dev/null
+++ b/Src/Plugins/Library/ml_wire/ChannelRefresher.cpp
@@ -0,0 +1,33 @@
+#include "main.h"
+#include "ChannelRefresher.h"
+#include <algorithm>
+
+#include "./subscriptionView.h"
+
+using namespace Nullsoft::Utility;
+void ChannelRefresher::BeginChannelSync()
+{}
+
+void ChannelRefresher::NewChannel(const Channel &newChannel)
+{
+ AutoLock lock (channels LOCKNAME("ChannelRefresher::NewChannel"));
+ ChannelList::iterator found;
+ for (found=channels.begin();found!=channels.end(); found++)
+ {
+ if (!wcscmp(found->url, newChannel.url))
+ break;
+ }
+ if (found != channels.end())
+ {
+ // todo, redo category indexing as necessary.
+ found->UpdateFrom(newChannel);
+ found->lastUpdate = _time64(0);
+ found->needsRefresh = false;
+ }
+}
+
+void ChannelRefresher::EndChannelSync()
+{
+ HWND wnd = SubscriptionView_FindWindow();
+ SubscriptionView_RefreshChannels(wnd, TRUE);
+} \ No newline at end of file