Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions doc/man/si/qnapi.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.TH "qnapi" 1
.SH NAME
qnapi \- aplikacija za prenos podnapisov

.SH SYNOPSIS
\fBqnapi\fP [ukaz] [seznam datotek]
.SH DESCRIPTION
\fBqnapi\fP je aplikacija za samodejni prenos podnapisov s spletnih strani napiprojekt.pl, napisy24.pl in opensubtitles.com.

\fBqnapi\fP works in two modes: GUI and CLI. You can download subtitles just by providing paths to the movie files as program arguments or use graphical interface and perform such an action there.
.SH ARGUMENTS

-c, \-\-console Prenesi podnapise preko konzole
-q, \-\-quiet Prenesi v ozadju, brez izpisovanja sporočil (vključuje tudi -d)

-s, \-\-show\-list Prikaži seznam podnapisov (deluje le z -c)
-d, \-\-dont\-show\-list Ne prikaži seznama podnapisov
(deluje le z -c)

-l, \-\-lang [code] Prvi jezik za podnapise
-lb,\-\-lang\-backup [code] Dodatni jeziki za podnapise
-f, \-\-format [format] Določi format podnapisov
(mDVD,MPL2,SRT,TMP)
-e, \-\-extension [ext] Določi datotečno končnico podnapisov
-o, \-\-options Prikaži nastavitve (le GUI)
-h, \-\-help Prikaži celotno pomoč
-hl,\-\-help\-languages Prikaži podprte jezike podnapisov

.SH AUTHOR
Vse pravice pridržane (C) 2008-2017 Piotr Krzeminski <[email protected]>
http://qnapi.github.io
.SH LICENSE
QNapi je izdan pod licenco GNU General Public License v2 ali novejšo.
.SH ISSUES
Napake v delovanju lahko prijavite preko GitHub-a: https://github.com/QNapi/qnapi/issues
Binary file added doc/man/si/qnapi.1.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions doc/qnapi-download.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Name[it_IT]=Scarica sottotitoli con QNapi
GenericName[it_IT]=Scarica sottotitoli con QNapi
Name[pl_PL]=Pobierz napisy do filmu z QNapi
GenericName[pl_PL]=Pobierz napisy do filmu z QNapi
Name[sl_SI]=Prenesi podnapise preko QNapi
GenericName[sl_SI]=Prenesi podnapise preko QNapi
Icon=qnapi-48
ServiceTypes=video/x-msvideo,video/x-ms-asf,video/mpeg,video/x-ms-wmv,video/mp4,video/quicktime,video/x-theora,video/x-matroska,video/3gpp,application/vnd.rn-realmedia,application/vnd.rn-realmedia-vbr
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
Expand All @@ -16,5 +18,6 @@ Type=Service
Name=Download subtitles with QNapi
Name[it_IT]=Scarica sottotitoli con QNapi
Name[pl_PL]=Pobierz napisy do filmu z QNapi
Name[sl_SI]=Prenesi podnapise preko QNapi
Exec=qnapi %F
Icon=qnapi-48
3 changes: 3 additions & 0 deletions doc/qnapi-scan.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Name[it_IT]=Scansiona cartella e scarica sottotitoli
GenericName[it_IT]=Scansiona cartella e scarica sottotitoli
Name[pl_PL]=Przeskanuj katalog i pobierz napisy
GenericName[pl_PL]=Przeskanuj katalogu i pobierz napisy
Name[sl_SI]=Poišči datoteke v mapi in prenesi podnapise
GenericName[sl_SI]=Poišči datoteke v mapi in prenesi podnapise
Icon=qnapi-48
ServiceTypes=inode/directory
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
Expand All @@ -16,5 +18,6 @@ Type=Service
Name=Scan directory and download subtitles
Name[it_IT]=Scansiona cartella e scarica sottotitoli
Name[pl_PL]=Przeskanuj katalog i pobierz napisy
Name[sl_SI]=Poišči datoteke v mapi in prenesi podnapise
Exec=qnapi %U
Icon=qnapi-48
35 changes: 35 additions & 0 deletions doc/qnapi.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>io.github.qnapi</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>QNapi</name>
<summary>A software for downloading and automatic matching subtitles to movies</summary>
<description>
<p>QNapi is designed to automatically download and match subtitles to a specific movie file. Unlike similar programs, QNapi queries several different subtitle databases to find the best subtitles for your movie. Also, thanks to the QT library, the program runs on various operating systems (Windows, OSX, Linux).</p>
<ul>
<li>matching subtitles for specific movie file</li>
<li>automatic matching the best subtitles</li>
<li>select target subtitles format (SRT, mDVD, TMP, MPL2) as well as manual conversion</li>
<li>select subtitles, when multiple matching has been found</li>
<li>download subtitles in one of many supported languages</li>
<li>directory scanning and batch subtitles download</li>
<li>subtitles post-processing: change file encoding, set file permissions</li>
<li>provides nice command-line interface</li>
</ul>
</description>
<launchable type="desktop-id">qnapi.desktop</launchable>
<url type="homepage">https://qnapi.github.io/</url>
<screenshots>
<screenshot type="default">
<image>https://qnapi.github.io/images/screenshots/0.1.7/lin05.png</image>
</screenshot>
</screenshots>
<content_rating type="oars-1.1">
<content_attribute id="social-chat">intense</content_attribute>
</content_rating>
<url type="bugtracker">https://github.com/QNapi/qnapi/issues</url>
<url type="help">https://qnapi.github.io/#help</url>
<url type="donation">https://qnapi.github.io/#donate</url>
<developer_name>Piotr Krzemiński</developer_name>
</component>
3 changes: 3 additions & 0 deletions doc/qnapi.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Exec=qnapi %U
Name=QNapi
Name[it_IT]=QNapi
Name[pl_PL]=QNapi
Name[sl_SI]=QNapi
Icon=qnapi
Type=Application
Categories=AudioVideo;
Expand All @@ -12,5 +13,7 @@ Comment[it_IT]=Programma per scaricare sottotitoli di film
GenericName[it_IT]=Programma per scaricare sottotitoli di film
Comment[pl_PL]=Program do pobierania napisów do filmów
GenericName[pl_PL]=Program do pobierania napisów do filmów
Comment[sl_SI]=Program za prenos podnapisov
GenericName[sl_SI]=Program za prenos podnapisov
Terminal=false
X-KDE-StartupNotify=false
Binary file added gui/res/langs/si.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions gui/ui/frmoptions.ui
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@
<iconset resource="../res/resources.qrc">
<normaloff>:/languages/pl.png</normaloff>:/languages/pl.png</iconset>
</property>
</item>
<item>
<property name="text">
<string comment="si">Slovenian</string>
</property>
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/languages/si.png</normaloff>:/languages/si.png</iconset>
</property>
</item>
</widget>
</item>
Expand Down
32 changes: 18 additions & 14 deletions libqnapi/src/subtitlepostprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ SubtitlePostProcessor::SubtitlePostProcessor(

void SubtitlePostProcessor::perform(const QString& movieFilePath,
const QString& subtitleFilePath) const {
if (!QFileInfo(subtitleFilePath).exists()) return;

if (ppConfig.removeLines()) {
ppRemoveLinesContainingWords(subtitleFilePath, ppConfig.removeLinesWords());
}
Expand All @@ -35,11 +37,9 @@ void SubtitlePostProcessor::perform(const QString& movieFilePath,
ppReplaceDiacriticsWithASCII(subtitleFilePath);
break;
case ECM_CHANGE:
if (!ppConfig.encodingAutoDetectFrom() ||
!ppChangeSubtitlesEncoding(subtitleFilePath, ppConfig.encodingTo())) {
ppChangeSubtitlesEncoding(subtitleFilePath, ppConfig.encodingFrom(),
ppChangeSubtitlesEncoding(subtitleFilePath,
ppDetermineEncodingFrom(subtitleFilePath),
ppConfig.encodingTo());
}
break;
case ECM_ORIGINAL:
// Nie ruszaj pobranych napisów!
Expand All @@ -55,7 +55,6 @@ void SubtitlePostProcessor::perform(const QString& movieFilePath,

bool SubtitlePostProcessor::ppReplaceDiacriticsWithASCII(
const QString& subtitleFilePath) const {
if (!QFileInfo(subtitleFilePath).exists()) return false;

QString from = encodingUtils.detectFileEncoding(subtitleFilePath);

Expand Down Expand Up @@ -84,6 +83,12 @@ bool SubtitlePostProcessor::ppReplaceDiacriticsWithASCII(
bool SubtitlePostProcessor::ppChangeSubtitlesEncoding(
const QString& subtitleFilePath, const QString& from,
const QString& to) const {

if (QString::compare(from, ppConfig.encodingTo(), Qt::CaseInsensitive) == 0) {
// The same encoding, conversion isn't required.
return false;
}

QFile f(subtitleFilePath);
if (!f.open(QIODevice::ReadOnly)) return false;

Expand All @@ -109,20 +114,19 @@ bool SubtitlePostProcessor::ppChangeSubtitlesEncoding(
return true;
}

bool SubtitlePostProcessor::ppChangeSubtitlesEncoding(
const QString& subtitleFilePath, const QString& to) const {
if (!QFileInfo(subtitleFilePath).exists()) return false;

QString from = encodingUtils.detectFileEncoding(subtitleFilePath);

if (from.isEmpty()) return false;
QString SubtitlePostProcessor::ppDetermineEncodingFrom(const QString& subtitleFilePath) const {
if (ppConfig.encodingAutoDetectFrom()) {
QString autodetectedFrom = encodingUtils.detectFileEncoding(subtitleFilePath);
if (!autodetectedFrom.isEmpty()) {
return autodetectedFrom;
}
}

return ppChangeSubtitlesEncoding(from, to);
return ppConfig.encodingFrom();
}

bool SubtitlePostProcessor::ppRemoveLinesContainingWords(
const QString& subtitleFilePath, QStringList wordList) const {
if (!QFileInfo(subtitleFilePath).exists()) return false;

wordList = wordList.filter(QRegExp("^(.+)$"));

Expand Down
3 changes: 1 addition & 2 deletions libqnapi/src/subtitlepostprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class SubtitlePostProcessor {
bool ppReplaceDiacriticsWithASCII(const QString& subtitleFilePath) const;
bool ppChangeSubtitlesEncoding(const QString& subtitleFilePath,
const QString& from, const QString& to) const;
bool ppChangeSubtitlesEncoding(const QString& subtitleFilePath,
const QString& to) const;
QString ppDetermineEncodingFrom(const QString& subtitleFilePath) const;
bool ppRemoveLinesContainingWords(const QString& subtitleFilePath,
QStringList wordList) const;

Expand Down
6 changes: 4 additions & 2 deletions qnapi.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ no_cli:SUBDIRS -= cli
no_gui:message(will skip building qnapi gui application)
no_gui:SUBDIRS -= gui

TRANSLATIONS += translations/qnapi_it.ts translations/qnapi_pl.ts
TRANSLATIONS += translations/qnapi_it.ts translations/qnapi_pl.ts translations/qnapi_si.ts

include(qnapi.pri)

Expand Down Expand Up @@ -46,7 +46,9 @@ unix {

desktop.path = $${INSTALL_PREFIX}/share/applications
desktop.files = doc/qnapi.desktop
INSTALLS += doc man man_it man_pl desktop
metainfo.path = $${INSTALL_PREFIX}/share/metainfo
metainfo.files = doc/qnapi.appdata.xml
INSTALLS += doc man man_it man_pl desktop metainfo
}

macx:!no_gui {
Expand Down
Binary file added translations/qnapi_si.qm
Binary file not shown.
Loading