mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
- lcd4l/weather: fix creation of data files for first run
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -1053,7 +1053,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
|
||||
strcpy(m_Duration, Duration);
|
||||
}
|
||||
|
||||
if (g_settings.weather_enabled && CWeather::getInstance()->checkUpdate())
|
||||
if (g_settings.weather_enabled && CWeather::getInstance()->checkUpdate(firstRun))
|
||||
{
|
||||
std::string wtemp = CWeather::getInstance()->getActTemp();
|
||||
std::string wicon = CWeather::getInstance()->getActIcon();
|
||||
|
@@ -78,10 +78,10 @@ void CWeather::setCoords(std::string new_coords, std::string new_city)
|
||||
}
|
||||
}
|
||||
|
||||
bool CWeather::checkUpdate()
|
||||
bool CWeather::checkUpdate(bool forceUpdate)
|
||||
{
|
||||
time_t current_time = time(NULL);
|
||||
if (difftime(current_time,last_time) > MINUTES)
|
||||
if (forceUpdate || (difftime(current_time,last_time) > MINUTES))
|
||||
return GetWeatherDetails();
|
||||
else
|
||||
return false;
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
static CWeather* getInstance();
|
||||
CWeather();
|
||||
~CWeather();
|
||||
bool checkUpdate();
|
||||
bool checkUpdate(bool forceUpdate = false);
|
||||
void setCoords(std::string new_coords, std::string new_city = "Unknown");
|
||||
void show(int x = 50, int y = 50);
|
||||
void hide();
|
||||
|
Reference in New Issue
Block a user