Skip to content
Browse files

vdr-plugin-vnsiserver: check and reset modified flag for channels ins…

…tead of looking at file
  • Loading branch information...
1 parent fa8ccb6 commit a38c3a6df445bbf677c01c8bd13597791d21d74a @FernetMenta FernetMenta committed
Showing with 6 additions and 14 deletions.
  1. +6 −14 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/vnsiserver.c
View
20 addons/pvr.vdr.vnsi/vdr-plugin-vnsiserver/vnsiserver.c
@@ -188,10 +188,6 @@ void cVNSIServer::Action(void)
fd_set fds;
struct timeval tv;
- // initial time for channels change
- struct timespec channelsUpdate;
- channelsUpdate.tv_sec = 0;
- channelsUpdate.tv_nsec = 0;
cTimeMs chanTimer(0);
// get initial state of the recordings
@@ -261,17 +257,13 @@ void cVNSIServer::Action(void)
// trigger clients to reload the modified channel list
if(m_clients.size() > 0 && chanTimer.TimedOut())
{
- struct stat s;
- if(stat(Channels.FileName(), &s) != -1)
+ int modified = Channels.Modified();
+ if (modified)
{
- if ((s.st_mtim.tv_sec != channelsUpdate.tv_sec) &&
- (s.st_mtim.tv_nsec != channelsUpdate.tv_nsec))
- {
- INFOLOG("Requesting clients to reload channel list");
- for (ClientList::iterator i = m_clients.begin(); i != m_clients.end(); i++)
- (*i)->ChannelChange();
- channelsUpdate = s.st_mtim;
- }
+ Channels.SetModified((modified == CHANNELSMOD_USER) ? true : false);
+ INFOLOG("Requesting clients to reload channel list");
+ for (ClientList::iterator i = m_clients.begin(); i != m_clients.end(); i++)
+ (*i)->ChannelChange();
}
chanTimer.Set(5000);
}

0 comments on commit a38c3a6

Please sign in to comment.
Something went wrong with that request. Please try again.