Skip to content

Commit

Permalink
Merge pull request #18 from olzzon/develop
Browse files Browse the repository at this point in the history
Added subfolder .filter to support  CCG 2.2
  • Loading branch information
olzzon authored Jan 27, 2019
2 parents 11178c7 + 09d6332 commit ba9da17
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 ba9da17

Please sign in to comment.