Skip to content

Commit

Permalink
Fix: added subfolder .filter as CCG 2.2 does not support subfolder ar…
Browse files Browse the repository at this point in the history
…gument in the CLS command.
  • Loading branch information
olzzon committed Jan 26, 2019
1 parent e551ef8 commit 09d6332
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/Thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const FPS = 25;
import { connect } from "react-redux";

//Utils:
import {cleanUpFilename, extractFilenameFromPath} from '../util/filePathStringHandling';
import { cleanUpFilename } from '../util/filePathStringHandling';


class Thumbnail extends PureComponent {
Expand Down Expand Up @@ -57,10 +57,18 @@ class Thumbnail extends PureComponent {


loadThumbs() {
this.props.ccgConnectionProps.cls(this.props.store.settingsReducer[0].settings.tabData[this.props.ccgOutputProps-1].subFolder)
//Filter files manually as
//CCG 2.2 does not support subfolder argument in the CLS command
let subFolder = cleanUpFilename(this.props.store.settingsReducer[0].settings.tabData[this.props.ccgOutputProps-1].subFolder);
//Remove first backslash if it´s there:
subFolder = (subFolder.length && subFolder[0] == '/') ? subFolder.slice(1) : subFolder;

this.props.ccgConnectionProps.cls()
.then((results) => {
let items = results.response.data.filter((item) => {
return item.type === 'video';
return (item.type === 'video' &&
item.name.includes(subFolder)
);
});
if (items.length === 0) return false;
this.props.dispatch({
Expand Down

0 comments on commit 09d6332

Please sign in to comment.