Rework to avoid using preferences object to retrieve options

This commit is contained in:
Guillaume Tâche
2024-09-22 21:59:10 +02:00
parent 7f99c48e2c
commit c59619da2d
115 changed files with 2294 additions and 765 deletions

View File

@@ -3,9 +3,9 @@ package com.github.gtache.autosubtitle.client;
import com.github.gtache.autosubtitle.Audio;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.VideoConverter;
import com.github.gtache.autosubtitle.subtitle.ExportOptions;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collection;
@@ -14,27 +14,28 @@ import java.util.Collection;
*/
public class RemoteVideoConverter implements VideoConverter {
@Override
public Video addSoftSubtitles(final Video video, final Collection<? extends SubtitleCollection<?>> subtitles) throws IOException {
public Video addSoftSubtitles(final Video video, final Collection<? extends SubtitleCollection<?>> subtitles, final ExportOptions options) {
throw new UnsupportedOperationException();
}
@Override
public void addSoftSubtitles(final Video video, final Collection<? extends SubtitleCollection<?>> subtitles, final Path path) throws IOException {
public void addSoftSubtitles(final Video video, final Collection<? extends SubtitleCollection<?>> subtitles, final ExportOptions options, final Path path) {
throw new UnsupportedOperationException();
}
@Override
public Video addHardSubtitles(final Video video, final SubtitleCollection<?> subtitles) throws IOException {
public Video addHardSubtitles(final Video video, final SubtitleCollection<?> subtitles, final ExportOptions options) {
throw new UnsupportedOperationException();
}
@Override
public void addHardSubtitles(final Video video, final SubtitleCollection<?> subtitles, final ExportOptions options, final Path path) {
throw new UnsupportedOperationException();
}
@Override
public void addHardSubtitles(final Video video, final SubtitleCollection<?> subtitles, final Path path) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public Audio getAudio(final Video video) throws IOException {
public Audio getAudio(final Video video) {
throw new UnsupportedOperationException();
}
}

View File

@@ -3,7 +3,6 @@ package com.github.gtache.autosubtitle.client;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.VideoLoader;
import java.io.IOException;
import java.nio.file.Path;
/**
@@ -11,7 +10,7 @@ import java.nio.file.Path;
*/
public class RemoteVideoLoader implements VideoLoader {
@Override
public Video loadVideo(final Path path) throws IOException {
public Video loadVideo(final Path path) {
throw new UnsupportedOperationException();
}
}

View File

@@ -1,9 +1,9 @@
package com.github.gtache.autosubtitle.subtitle.converter.client;
import com.github.gtache.autosubtitle.VideoInfo;
import com.github.gtache.autosubtitle.subtitle.Subtitle;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import com.github.gtache.autosubtitle.subtitle.converter.ParseException;
import com.github.gtache.autosubtitle.subtitle.converter.FormatOptions;
import com.github.gtache.autosubtitle.subtitle.converter.ParseOptions;
import com.github.gtache.autosubtitle.subtitle.converter.SubtitleConverter;
/**
@@ -13,12 +13,12 @@ import com.github.gtache.autosubtitle.subtitle.converter.SubtitleConverter;
*/
public class RemoteSubtitleConverter<T extends Subtitle> implements SubtitleConverter<T> {
@Override
public String format(final SubtitleCollection<?> collection, final VideoInfo videoInfo) {
public String format(final SubtitleCollection<?> collection, final FormatOptions options) {
throw new UnsupportedOperationException();
}
@Override
public SubtitleCollection<T> parse(final String content) throws ParseException {
public SubtitleCollection<T> parse(final String content, final ParseOptions options) {
throw new UnsupportedOperationException();
}

View File

@@ -1,11 +1,9 @@
package com.github.gtache.autosubtitle.subtitle.extractor.client;
import com.github.gtache.autosubtitle.Audio;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractException;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModel;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractOptions;
import com.github.gtache.autosubtitle.subtitle.extractor.SubtitleExtractor;
import com.github.gtache.autosubtitle.subtitle.extractor.impl.AbstractSubtitleExtractor;
@@ -15,12 +13,12 @@ import com.github.gtache.autosubtitle.subtitle.extractor.impl.AbstractSubtitleEx
public class RemoteSubtitleExtractor extends AbstractSubtitleExtractor {
@Override
public SubtitleCollection extract(final Video video, final Language language, final ExtractionModel model) throws ExtractException {
public SubtitleCollection extract(final Video video, final ExtractOptions options) {
throw new UnsupportedOperationException();
}
@Override
public SubtitleCollection extract(final Audio audio, final Language language, final ExtractionModel model) throws ExtractException {
public SubtitleCollection extract(final Audio audio, final ExtractOptions options) {
throw new UnsupportedOperationException();
}
}

View File

@@ -3,7 +3,6 @@ package com.github.gtache.autosubtitle.translation.client;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.subtitle.Subtitle;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import com.github.gtache.autosubtitle.translation.TranslationException;
import com.github.gtache.autosubtitle.translation.Translator;
/**
@@ -18,17 +17,17 @@ public class RemoteTranslator<T extends Subtitle> implements Translator<T> {
}
@Override
public String translate(final String text, final Language from, final Language to) throws TranslationException {
public String translate(final String text, final Language from, final Language to) {
throw new UnsupportedOperationException();
}
@Override
public T translate(final Subtitle subtitle, final Language from, final Language to) throws TranslationException {
public T translate(final Subtitle subtitle, final Language from, final Language to) {
throw new UnsupportedOperationException();
}
@Override
public SubtitleCollection<T> translate(final SubtitleCollection<?> collection, final Language from, final Language to) throws TranslationException {
public SubtitleCollection<T> translate(final SubtitleCollection<?> collection, final Language from, final Language to) {
throw new UnsupportedOperationException();
}
}