| 1522 | static gchar *last_scan_file = NULL; |
| 1523 | |
| 1524 | void |
| 1525 | ghb_do_scan_list (signal_user_data_t *ud, GListModel *files, int title_id, gboolean force) |
| 1526 | { |
| 1527 | int titleindex; |
| 1528 | |
| 1529 | if (!g_list_model_get_n_items(files)) |
| 1530 | return; |
| 1531 | |
| 1532 | g_autoptr(GFile) file = g_list_model_get_item(files, 0); |
| 1533 | const char *filename = g_file_peek_path(file); |
| 1534 | |
| 1535 | ghb_log_func(); |
| 1536 | if (!force && last_scan_file != NULL && |
| 1537 | strcmp(last_scan_file, filename) == 0) |
| 1538 | { |
| 1539 | if (ghb_queue_edit_settings != NULL) |
| 1540 | { |
| 1541 | title_id = ghb_dict_get_int(ghb_queue_edit_settings, "title"); |
| 1542 | ghb_lookup_title(title_id, &titleindex); |
| 1543 | ghb_array_replace(ud->settings_array, titleindex, |
| 1544 | ghb_queue_edit_settings); |
| 1545 | ud->settings = ghb_queue_edit_settings; |
| 1546 | ghb_load_settings(ud); |
| 1547 | ghb_queue_edit_settings = NULL; |
| 1548 | } |
| 1549 | else |
| 1550 | { |
| 1551 | ghb_lookup_title(title_id, &titleindex); |
| 1552 | load_all_titles(ud, titleindex); |
| 1553 | } |
| 1554 | return; |
| 1555 | } |
| 1556 | if (last_scan_file != NULL) |
| 1557 | g_free(last_scan_file); |
| 1558 | last_scan_file = NULL; |
| 1559 | if (filename != NULL) |
| 1560 | { |
| 1561 | gint preview_count; |
| 1562 | |
| 1563 | last_scan_file = g_strdup(filename); |
| 1564 | ghb_set_scan_source(filename); |
| 1565 | |
| 1566 | show_scan_progress(ud); |
| 1567 | prune_logs(); |
| 1568 | |
| 1569 | preview_count = ghb_dict_get_int(ud->prefs, "preview_count"); |
| 1570 | start_scan_list(ud, files, title_id, preview_count); |
| 1571 | } |
| 1572 | } |
| 1573 | void |
| 1574 | ghb_do_scan (signal_user_data_t *ud, const char *filename, int title_id, gboolean force) |
| 1575 | { |
no test coverage detected