| 1538 | // Since there's no DB update to remove imdb.pl settings in -fixes, |
| 1539 | // check for the old imdb.pl command and, if it's the old default, |
| 1540 | // use tmdb.pl, instead (if available in the same location or the |
| 1541 | // scripts dir)). Checks to see if cmd ends with end (the end of the |
| 1542 | // old default imdb.pl command line). If so, it checks for tmdb, and |
| 1543 | // if it exists in either the same location as specified in cmd or in |
| 1544 | // the MythVideo scripts directory, replace end with "/tmdb.pl " + arg |
| 1545 | QString UpdateCommandForTMDB(const QString cmd, const QString end, |
| 1546 | const QString arg) |
| 1547 | { |
| 1548 | QString updated_cmd = cmd; |
| 1549 | if (updated_cmd.endsWith(end)) |
| 1550 | { |
| 1551 | QString script_path = updated_cmd; |
| 1552 | script_path.truncate(updated_cmd.findRev(end, |
| 1553 | 0 - end.length())); |
| 1554 | QString tmdb_path(script_path + "/tmdb.pl"); |
| 1555 | if (QFile::exists(tmdb_path)) |
| 1556 | { |
| 1557 | VERBOSE(VB_GENERAL, QString("Overriding old default " |
| 1558 | "grabber script command line. " |
| 1559 | "Using tmdb.pl, instead.")); |
| 1560 | updated_cmd = tmdb_path + " " + arg; |
| 1561 | } |
| 1562 | else |
| 1563 | { |
| 1564 | // It's possible the user has a non-default imdb.pl |
| 1565 | // command-line--including path location--in the setting, |
| 1566 | // so check to see if we've already checked the mythvideo |
| 1567 | // scripts directory |
| 1568 | QString def_path = QDir::cleanDirPath(QString("%1/%2") |
| 1569 | .arg(gContext->GetShareDir()) |
| 1570 | .arg("mythvideo/scripts")); |
| 1571 | if (script_path != def_path) |
| 1572 | { |
| 1573 | tmdb_path = def_path + "/tmdb.pl"; |
| 1574 | if (QFile::exists(tmdb_path)) |
| 1575 | { |
| 1576 | VERBOSE(VB_GENERAL, QString("Overriding old " |
| 1577 | "default grabber script command line. " |
| 1578 | "Using tmdb.pl, instead.")); |
| 1579 | updated_cmd = tmdb_path + " " + arg; |
| 1580 | } |
| 1581 | } |
| 1582 | } |
| 1583 | } |
| 1584 | |
| 1585 | return updated_cmd; |
| 1586 | } |
| 1587 | |
1629 | | QString cmd = gContext->GetSetting("MovieListCommandLine", def_cmd); |
| 1679 | // Since there's no DB update to remove imdb.pl settings in -fixes, |
| 1680 | // check for the old imdb.pl command and, if it's the old default, |
| 1681 | // use tmdb.pl, instead (if available in the same location or the |
| 1682 | // scripts dir)) |
| 1683 | QString cmd = UpdateCommandForTMDB( |
| 1684 | gContext->GetSetting("MovieListCommandLine", |
| 1685 | def_cmd), |
| 1686 | "/imdb.pl -M tv=no;video=no", "-M"); |
1685 | | .arg("mythvideo/scripts/imdb.pl -D")); |
1686 | | const QString cmd = gContext->GetSetting("MovieDataCommandLine", |
1687 | | def_cmd); |
| 1742 | .arg("mythvideo/scripts/tmdb.pl -D")); |
| 1743 | // Since there's no DB update to remove imdb.pl settings in -fixes, |
| 1744 | // check for the old imdb.pl command and, if it's the old default, |
| 1745 | // use tmdb.pl, instead (if available in the same location or the |
| 1746 | // scripts dir)) |
| 1747 | const QString cmd = UpdateCommandForTMDB( |
| 1748 | gContext->GetSetting("MovieDataCommandLine", |
| 1749 | def_cmd), |
| 1750 | "/imdb.pl -D", "-D"); |
1729 | | .arg("mythvideo/scripts/imdb.pl -P")); |
1730 | | const QString cmd = gContext->GetSetting("MoviePosterCommandLine", |
1731 | | default_cmd); |
| 1792 | .arg("mythvideo/scripts/tmdb.pl -P")); |
| 1793 | // Since there's no DB update to remove imdb.pl settings in -fixes, |
| 1794 | // check for the old imdb.pl command and, if it's the old default, |
| 1795 | // use tmdb.pl, instead (if available in the same location or the |
| 1796 | // scripts dir)) |
| 1797 | const QString cmd = UpdateCommandForTMDB( |
| 1798 | gContext->GetSetting("MoviePosterCommandLine", |
| 1799 | default_cmd), |
| 1800 | "/imdb.pl -P", "-P"); |
| 1801 | |