cosarara / fucking-weeb

A library manager for anime and series
GNU General Public License v3.0
42 stars 3 forks source link

Add autoplay feature. #4

Closed ekisu closed 7 years ago

ekisu commented 7 years ago

Adds autoplay feature. I think it probably break with old DBs, because of the new field...

cosarara commented 7 years ago

I'm looking at it, for now on a separate branch: https://github.com/cosarara97/fucking-weeb/commits/autoplay

(get that couple commits on your branch first)

cosarara commented 7 years ago

With autoplay enabled, If you play a video, then go play another, when the 2nd process ends you'll get a crash:

Error: (process-wait) waiting for child process failed - No child processes: 25823

Call history:

weeb.scm:838: gtk_label_set_attributes
weeb.scm:839: pango_attr_list_unref
weeb.scm:861: g_timeout_add_seconds
weeb.scm:862: gtk_box_pack_start
weeb.scm:864: gtk_button_new_with_label
weeb.scm:229: ##sys#make-c-string
weeb.scm:865: g_signal_connect
weeb.scm:229: ##sys#make-c-string
weeb.scm:866: gtk_box_pack_start
weeb.scm:870: gtk_widget_show_all
weeb.scm:878: get-autoplay
weeb.scm:879: data->id
weeb.scm:478: pointer->address
weeb.scm:880: get-item
weeb.scm:874: ##sys#call-with-values
weeb.scm:881: process-wait <--

ekisu commented 7 years ago

You say, as in watching multiple series at the same time? Or multiple episodes from the same series? I'll try passing the callback arguments to g_timeout_add instead of setting it on a global, it should work if the problem is that it waits twice on a process.

cosarara commented 7 years ago

I meant from 2 different series, but both things should work. I see you are working on it.

ekisu commented 7 years ago

I don't know how autoplaying multiple eps from the same series should behave. Right now, it plays the next ep, after the process ends (like the "Watch next" button, it sets the current ep to the next one). If multiple eps are played at the same time, this approach won't work - say, if ep 4 and 12 are played on the same time (first 4, then 12), when ep 4 ends, the next ep will be 13, because curr-ep is set to 12.

Should it only play one episode at a time, and disable the Watch buttons when playing? Or not rely on curr-ep?

cosarara commented 7 years ago

I think a good behaviour would be the following:

ekisu commented 7 years ago

I think I might have misunderstood you - when playing from multiple series, track only one process overall or one process per series?

cosarara commented 7 years ago

I meant overall. That's what you did, right?

ekisu commented 7 years ago

Yeah, that's what I did.