Source:
private void setMetadataFromFileName(File file) { String[] metadataFromFilename = FileUtil.getFileNameMetadata(file.getName()); String titleFromFilename = metadataFromFilename[0]; String yearFromFilename = metadataFromFilename[1]; String extraInformationFromFilename = metadataFromFilename[2]; String tvSeasonFromFilename = metadataFromFilename[3]; String tvEpisodeNumberFromFilename = metadataFromFilename[4]; String tvEpisodeNameFromFilename = metadataFromFilename[5]; String titleFromFilenameSimplified = FileUtil.getSimplifiedShowName(titleFromFilename); media.setMovieOrShowName(titleFromFilename); media.setSimplifiedMovieOrShowName(titleFromFilenameSimplified); String titleFromDatabase; String titleFromDatabaseSimplified; if (StringUtils.isNotBlank(tvSeasonFromFilename) && StringUtils.isNotBlank(tvEpisodeNumberFromFilename)) { titleFromDatabase = PMS.get().getSimilarTVSeriesName(titleFromFilename); titleFromDatabaseSimplified = FileUtil.getSimplifiedShowName(titleFromDatabase); if (titleFromFilenameSimplified.equals(titleFromDatabaseSimplified)) { media.setMovieOrShowName(titleFromDatabase); } media.setTVSeason(tvSeasonFromFilename); media.setTVEpisodeNumber(tvEpisodeNumberFromFilename); if (StringUtils.isNotBlank(tvEpisodeNameFromFilename)) { media.setTVEpisodeName(tvEpisodeNameFromFilename); } media.setIsTVEpisode(true); } if (yearFromFilename != null) { media.setYear(yearFromFilename); } if (extraInformationFromFilename != null) { media.setExtraInformation(extraInformationFromFilename); } try { if (configuration.getUseCache()) { PMS.get().getDatabase().insertVideoMetadata(file.getAbsolutePath(), file.lastModified(), media); } } catch (SQLException e) { LOGGER.error( "Could not update the database with information from the filename for \"{}\": {}", file.getAbsolutePath(), e.getMessage() ); LOGGER.trace("", e); } finally { if (configuration.isUseInfoFromIMDb()) { OpenSubtitle.backgroundLookupAndAdd(file, media); } } public boolean isAddToMediaLibrary() { return true; } }

Target:
private void setMetadataFromFileName(File file) { String[] metadataFromFilename = FileUtil.getFileNameMetadata(file.getName()); String titleFromFilename = metadataFromFilename[0]; String yearFromFilename = metadataFromFilename[1]; String extraInformationFromFilename = metadataFromFilename[2]; String tvSeasonFromFilename = metadataFromFilename[3]; String tvEpisodeNumberFromFilename = metadataFromFilename[4]; String tvEpisodeNameFromFilename = metadataFromFilename[5]; String titleFromFilenameSimplified = FileUtil.getSimplifiedShowName(titleFromFilename); media.setMovieOrShowName(titleFromFilename); media.setSimplifiedMovieOrShowName(titleFromFilenameSimplified); String titleFromDatabase; String titleFromDatabaseSimplified; if (StringUtils.isNotBlank(tvSeasonFromFilename) && StringUtils.isNotBlank(tvEpisodeNumberFromFilename)) { titleFromDatabase = PMS.get().getSimilarTVSeriesName(titleFromFilename); titleFromDatabaseSimplified = FileUtil.getSimplifiedShowName(titleFromDatabase); if (titleFromFilenameSimplified.equals(titleFromDatabaseSimplified)) { media.setMovieOrShowName(titleFromDatabase); } media.setTVSeason(tvSeasonFromFilename); media.setTVEpisodeNumber(tvEpisodeNumberFromFilename); if (StringUtils.isNotBlank(tvEpisodeNameFromFilename)) { media.setTVEpisodeName(tvEpisodeNameFromFilename); } media.setIsTVEpisode(true); } if (yearFromFilename != null) { media.setYear(yearFromFilename); } if (extraInformationFromFilename != null) { media.setExtraInformation(extraInformationFromFilename); } try { if (configuration.getUseCache()) { PMS.get().getDatabase().insertVideoMetadata(file.getAbsolutePath(), file.lastModified(), media); } } catch (SQLException e) { LOGGER.error( "Could not update the database with information from the filename for \"{}\": {}", file.getAbsolutePath(), e.getMessage() ); LOGGER.trace("", e); } finally { if (configuration.isUseInfoFromIMDb()) { OpenSubtitle.backgroundLookupAndAdd(file, media); } } }