Skip to content

Commit

Permalink
chore(core): Remove unused AssetService.findByFileName() method
Browse files Browse the repository at this point in the history
Closes #366
  • Loading branch information
michaelbromley committed Jun 8, 2020
1 parent dd4bbc9 commit 96ea811
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions packages/core/src/service/services/asset.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,6 @@ export class AssetService {
return this.connection.getRepository(Asset).findOne(id);
}

/**
* Locates an Asset by the filename of the source file. If "exact" is set to false, filename will
* be looked up without the extension and with a "%" wildcard at the end. This is useful for finding
* files that may have been automatically renamed with a suffix by the AssetNamingStrategy.
*/
findByFileName(fileName: string, exact: boolean = true): Promise<Asset | undefined> {
const source = exact ? fileName : Like(path.basename(fileName, path.extname(fileName)) + '%');
return this.connection.getRepository(Asset).findOne({
where: {
source,
},
});
}

findAll(options?: ListQueryOptions<Asset>): Promise<PaginatedList<Asset>> {
return this.listQueryBuilder
.build(Asset, options)
Expand Down

0 comments on commit 96ea811

Please sign in to comment.