Skip to content

Commit

Permalink
no size in where
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Jan 17, 2025
1 parent d282cd8 commit a66f4a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public TorrentService(TorrentRepository torrentRepository) {
//@Cacheable(value = "torrent#600000", key = "#torrentIdentifier+'-'+#torrentSize")
public Torrent createOrGetTorrent(String torrentIdentifier, long torrentSize, Boolean isPrivate) {
Torrent t;
var torrentOptional = torrentRepository.findByIdentifierAndSize(torrentIdentifier, torrentSize);
var torrentOptional = torrentRepository.findByIdentifier(torrentIdentifier);
if (torrentOptional.isEmpty()) {
t = new Torrent(null, torrentIdentifier, torrentSize, isPrivate);
t = torrentRepository.save(t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@

public interface TorrentRepository extends SparkleCommonRepository<Torrent, Long> {
Optional<Torrent> findByIdentifierAndSize(@NonNull String identifier, @NonNull Long size);

Optional<Torrent> findByIdentifier(@NonNull String identifier);
}

0 comments on commit a66f4a7

Please sign in to comment.