summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2018-06-28 10:34:19 -0700
committerJohn Stebbins <[email protected]>2018-06-28 10:34:19 -0700
commitf947915145ce0c905f6a1ef64274a0860f642445 (patch)
tree4eade2a79800225bc9b218b536019ef110b93e8c
parent65bd07421937e06c2284d575a946e9bec73f151e (diff)
LinGui: Fix default destination filename for BDs
It was including the MPLS number as part of the default destination filename
-rw-r--r--gtk/src/callbacks.c8
-rw-r--r--gtk/src/hb-backend.c20
-rw-r--r--gtk/src/hb-backend.h3
3 files changed, 26 insertions, 5 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 940b9b975..97cf705b3 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -2646,7 +2646,6 @@ ghb_set_title_settings(signal_user_data_t *ud, GhbValue *settings)
if (title != NULL)
{
GhbValue *job_dict;
- char * source_name;
job_dict = hb_preset_job_init(ghb_scan_handle(), title_id, settings);
ghb_dict_set(settings, "Job", job_dict);
@@ -2660,9 +2659,10 @@ ghb_set_title_settings(signal_user_data_t *ud, GhbValue *settings)
ghb_dict_set_int(settings, "source_width", title->geometry.width);
ghb_dict_set_int(settings, "source_height", title->geometry.height);
ghb_dict_set_string(settings, "source", title->path);
- source_name = ghb_create_source_label(title);
- ghb_dict_set_string(settings, "source_label", source_name);
- ghb_dict_set_string(settings, "volume", source_name);
+ ghb_dict_set_string(settings, "source_label",
+ ghb_create_source_label(title));
+ ghb_dict_set_string(settings, "volume",
+ ghb_create_volume_label(title));
int crop[4];
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 3143eb8c4..9208db5a7 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -2081,6 +2081,26 @@ ghb_create_source_label(const hb_title_t * title)
}
gchar*
+ghb_create_volume_label(const hb_title_t * title)
+{
+ char * volname;
+
+ if (title != NULL && title->name != NULL && title->name[0] != 0)
+ {
+ volname = strdup(title->name);
+ if (title->type == HB_DVD_TYPE)
+ {
+ ghb_sanitize_volname(volname);
+ }
+ }
+ else
+ {
+ volname = g_strdup(_("No Title Found"));
+ }
+ return volname;
+}
+
+gchar*
ghb_create_title_label(const hb_title_t *title)
{
gchar *label;
diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h
index 7ebec5c1a..ed46f55b0 100644
--- a/gtk/src/hb-backend.h
+++ b/gtk/src/hb-backend.h
@@ -184,7 +184,6 @@ void ghb_audio_samplerate_opts_filter(GtkComboBox *combo, gint acodec);
int ghb_lookup_lang(const GhbValue *glang);
const iso639_lang_t* ghb_iso639_lookup_by_int(int idx);
void ghb_update_display_aspect_label(signal_user_data_t *ud);
-gchar* ghb_create_title_label(const hb_title_t *title);
// libhb lookup helpers
const hb_title_t* ghb_lookup_title(int title_id, int *index);
@@ -232,6 +231,8 @@ hb_handle_t* ghb_scan_handle(void);
hb_handle_t* ghb_queue_handle(void);
hb_handle_t* ghb_live_handle(void);
void ghb_sanitize_volname(gchar *name);
+gchar* ghb_create_title_label(const hb_title_t *title);
gchar* ghb_create_source_label(const hb_title_t * title);
+gchar* ghb_create_volume_label(const hb_title_t * title);
#endif // _HBBACKEND_H_