-
-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Assets not being Added #209
Comments
I was able to reproduce the bug following your steps. I noticed that the viewer does not call: I think the bug may be here in viewer.py: def refresh_playlist(self):
logging.debug('refresh_playlist')
time_cur = datetime.utcnow()
logging.debug('refresh: counter: (%s) deadline (%s) timecur (%s)', self.counter, self.deadline, time_cur)
if self.get_db_mtime() > self.last_update_db_mtime:
logging.debug('updating playlist due to database modification')
self.update_playlist()
elif settings['shuffle_playlist'] and self.counter >= 5:
self.update_playlist()
elif self.deadline and self.deadline <= time_cur:
self.update_playlist() Looks like none of those conditions are met for this use case, and thus the playlist is not checked for active assets? In the case of refreshing the page, looks like that probably triggers a database update. This seems like a common use case, so I think I am missing something. @vpetersson can give more information. |
Thanks for that. I have been looking through a bit of the code and the variable "self.deadline" seems to be so far in advance it never triggers the last else if statement. By looking at the code if I set it to shuffle then it should work, but that is not exactly what I want to do. |
Yeah, that is strange. I wonder how the deadline is calculated. From the log, I assume it would be the earliest end date of your currently enabled and active assets: Maybe deadline needs to include enabled and inactive assets? So in that case the deadline should be |
I agree it is only looking at the active assets and it is in UTC time, because my Time Zone is UTC +10 that would make sense. The deadline date is generated in the "generate_asset_list" procedure using end_date in the playlist. I think It needs some sort of if statement to check active by end date and non active by start date. What do you think @vpetersson |
The deadline for refreshing the playlist didn't take into account assets starting in the future, only end_dates of assets. This is fixed in the above commit. |
@brainrape Thank-you so much for fixing this issue so quickly! 👍 |
Hi There,
I am new to Screenly OSE and I am trying to get setup for a bit of advertising in our club.
I have setup as schedule to add some new assets for a bit of a test. As you can see in the image before I have two assets turned on for a week and and inactive asset "Steak2" setup for 2:45PM until 2:50PM
After 2:45PM the image never shows on the display, below is the log file.
Mon, 30 Jun 2014 14:45:07 Last update: 2014-06-30 10:53:12.173304
Mon, 30 Jun 2014 14:45:07 get_next_asset
Mon, 30 Jun 2014 14:45:07 refresh_playlist
Mon, 30 Jun 2014 14:45:07 refresh: counter: (0) deadline (2014-07-03 00:39:00) timecur (2014-06-30 04:45:07.209528)
Mon, 30 Jun 2014 14:45:07 get_next_asset after refresh
Mon, 30 Jun 2014 14:45:07 get_next_asset counter 0 returning asset 1 of 2
Mon, 30 Jun 2014 14:45:07 Showing asset Coffee (image)
Mon, 30 Jun 2014 14:45:07 Asset URI /home/pi/screenly_assets/145f6d06174749bba5945cfe125caeef
Mon, 30 Jun 2014 14:45:07 Already showing file:///tmp/screenly_html/black_page.html, keeping it.
Mon, 30 Jun 2014 14:45:07 Sleeping for 10
Mon, 30 Jun 2014 14:45:17 Last update: 2014-06-30 10:53:12.173304
Mon, 30 Jun 2014 14:45:17 get_next_asset
Mon, 30 Jun 2014 14:45:17 refresh_playlist
Mon, 30 Jun 2014 14:45:17 refresh: counter: (0) deadline (2014-07-03 00:39:00) timecur (2014-06-30 04:45:17.267812)
Mon, 30 Jun 2014 14:45:17 get_next_asset after refresh
Mon, 30 Jun 2014 14:45:17 get_next_asset counter 0 returning asset 2 of 2
Mon, 30 Jun 2014 14:45:17 Showing asset Cafe Oz - Coffee & Cake (image)
Mon, 30 Jun 2014 14:45:17 Asset URI /home/pi/screenly_assets/3efb7df4f846493dbcfb9bb0c03cf493
Mon, 30 Jun 2014 14:45:17 Already showing file:///tmp/screenly_html/black_page.html, keeping it.
Mon, 30 Jun 2014 14:45:17 Sleeping for 10
I then go back to the webpage and click on refresh the Asset is moved to being active and it then is shown on the display and in the log file.
Mon, 30 Jun 2014 14:47:48 Last update: 2014-06-30 10:53:12.173304
Mon, 30 Jun 2014 14:47:48 get_next_asset
Mon, 30 Jun 2014 14:47:48 refresh_playlist
Mon, 30 Jun 2014 14:47:48 refresh: counter: (0) deadline (2014-07-03 00:39:00) timecur (2014-06-30 04:47:48.060111)
Mon, 30 Jun 2014 14:47:48 updating playlist due to database modification
Mon, 30 Jun 2014 14:47:48 update_playlist
Mon, 30 Jun 2014 14:47:48 Generating asset-list...
Mon, 30 Jun 2014 14:47:48 generate_asset_list deadline: 2014-06-30 04:50:00
Mon, 30 Jun 2014 14:47:48 update_playlist done, count 3, counter 0, index 0, deadline 2014-06-30 04:50:00
Mon, 30 Jun 2014 14:47:48 get_next_asset after refresh
Mon, 30 Jun 2014 14:47:48 get_next_asset counter 0 returning asset 1 of 3
Mon, 30 Jun 2014 14:47:48 Showing asset Coffee (image)
Mon, 30 Jun 2014 14:47:48 Asset URI /home/pi/screenly_assets/145f6d06174749bba5945cfe125caeef
Mon, 30 Jun 2014 14:47:48 Already showing file:///tmp/screenly_html/black_page.html, keeping it.
Mon, 30 Jun 2014 14:47:48 Sleeping for 10
Mon, 30 Jun 2014 14:47:58 Last update: 2014-06-30 10:53:12.173304
Mon, 30 Jun 2014 14:47:58 get_next_asset
Mon, 30 Jun 2014 14:47:58 refresh_playlist
Mon, 30 Jun 2014 14:47:58 refresh: counter: (0) deadline (2014-06-30 04:50:00) timecur (2014-06-30 04:47:58.121203)
Mon, 30 Jun 2014 14:47:58 get_next_asset after refresh
Mon, 30 Jun 2014 14:47:58 get_next_asset counter 0 returning asset 2 of 3
Mon, 30 Jun 2014 14:47:58 Showing asset Steak2 (image)
Mon, 30 Jun 2014 14:47:58 Asset URI /home/pi/screenly_assets/8373385a2b454f94a4c3c8c5bba88247
Mon, 30 Jun 2014 14:47:58 Already showing file:///tmp/screenly_html/black_page.html, keeping it.
Mon, 30 Jun 2014 14:47:58 Sleeping for 10
Is there something I am doing wrong or is there a bug in the code?
Thanks
Duncan
The text was updated successfully, but these errors were encountered: